예제 #1
0
 public function testOverwritingExistingKeysWithSetOffset()
 {
     $sameKey = 'key';
     $dictionary = new Dictionary(gettype('teststring'), TestType::class);
     $dictionary[$sameKey] = new TestType('value');
     $newValue = new TestType('new-value');
     $dictionary->offsetSet($sameKey, $newValue);
     $this->assertEquals($newValue, $dictionary[$sameKey]);
     $this->assertEquals(1, $dictionary->count());
 }