Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+23 -3
View File
@@ -56,6 +56,15 @@ class OrderedHashMapTest extends TestCase
$this->assertSame(array(0 => 1, 'foo' => 2, 1 => 3), iterator_to_array($map));
}
public function testInsertLooselyEqualKeys()
{
$map = new OrderedHashMap();
$map['1 as a string'] = '1 as a string';
$map[1] = 1;
$this->assertSame(array('1 as a string' => '1 as a string', 1 => 1), iterator_to_array($map));
}
/**
* Updates should not change the position of an element, otherwise we could
* turn foreach loops into endless loops if they change the current
@@ -82,14 +91,14 @@ class OrderedHashMapTest extends TestCase
$map = new OrderedHashMap();
$map['first'] = 1;
$this->assertTrue(isset($map['first']));
$this->assertArrayHasKey('first', $map);
}
public function testIssetReturnsFalseForNonExisting()
{
$map = new OrderedHashMap();
$this->assertFalse(isset($map['first']));
$this->assertArrayNotHasKey('first', $map);
}
public function testIssetReturnsFalseForNull()
@@ -97,7 +106,7 @@ class OrderedHashMapTest extends TestCase
$map = new OrderedHashMap();
$map['first'] = null;
$this->assertFalse(isset($map['first']));
$this->assertArrayNotHasKey('first', $map);
}
public function testUnset()
@@ -111,6 +120,17 @@ class OrderedHashMapTest extends TestCase
$this->assertSame(array('second' => 2), iterator_to_array($map));
}
public function testUnsetFromLooselyEqualKeysHashMap()
{
$map = new OrderedHashMap();
$map['1 as a string'] = '1 as a string';
$map[1] = 1;
unset($map[1]);
$this->assertSame(array('1 as a string' => '1 as a string'), iterator_to_array($map));
}
public function testUnsetNonExistingSucceeds()
{
$map = new OrderedHashMap();