예제 #1
0
 /**
  * @expectedException \CollectionType\Exception\SynchronizeException
  *
  * @covers       CollectionType\Map\MapAbstract::put
  * @covers       CollectionType\Map\MapAbstract::isSynchronizedKeyAndValue
  * @covers       CollectionType\Map\MapAbstract::__construct
  * @covers       CollectionType\Common\KeyTypeTrait::validateValueForKeyType
  * @covers       CollectionType\Common\ValueTypeTrait::validateValueForValueType
  */
 public function testNotSynchronizedMapForValue()
 {
     $this->map->putValue('1');
     $key = '2';
     $value = '2';
     $this->dummyKeyType->isValid($key)->willReturn(true);
     $this->dummyValueType->isValid($value)->willReturn(true);
     $this->map->put($key, $value);
 }
예제 #2
0
 /**
  * @expectedException \CollectionType\Exception\SynchronizeException
  *
  * @covers       CollectionType\Map\MapAbstract::removeValue
  * @covers       CollectionType\Map\MapAbstract::validateValueForValueType
  * @covers       CollectionType\Map\MapAbstract::containsValue
  * @covers       CollectionType\Map\MapAbstract::__construct
  */
 public function testRemoveForNotSynchronizedMap()
 {
     $key1 = '1';
     $this->dummyKeyType->isValid($key1)->willReturn(true);
     $value1 = '1';
     $this->dummyValueType->isValid($value1)->willReturn(true);
     $this->map->put($key1, $value1);
     /** fake method, only for UnitTests */
     $this->map->putValue('2');
     $this->map->removeValue($key1);
 }