/** * @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 testNotSynchronizedMapForKey() { $this->map->putKey('1'); $key = '2'; $value = '2'; $this->dummyKeyType->isValid($key)->willReturn(true); $this->dummyValueType->isValid($value)->willReturn(true); $this->map->put($key, $value); }
/** * @expectedException \CollectionType\Exception\SynchronizeException * * @covers CollectionType\Map\MapAbstract::remove * @covers CollectionType\Map\MapAbstract::validateValueForKeyType * @covers CollectionType\Map\MapAbstract::containsKey * @covers CollectionType\Map\MapAbstract::isSynchronizedIndex * @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->putKey('2'); $this->map->remove($key1); }
/** * @expectedException \CollectionType\Exception\SynchronizeException * * @covers CollectionType\Map\MapAbstract::isEmpty * @covers CollectionType\Map\MapAbstract::__construct * @covers CollectionType\Map\MapAbstract::isSynchronizedIndex */ public function testIsEmptyForNotSynchronizedMap() { $this->map->putKey(1); $this->map->isEmpty(); }
/** * @expectedException \CollectionType\Exception\SynchronizeException * * @covers CollectionType\Map\MapAbstract::count * @covers CollectionType\Map\MapAbstract::__construct * @covers CollectionType\Map\MapAbstract::isSynchronizedIndex */ public function testCountForNotSynchronizedMap() { $this->map->putKey(1); $this->map->count(); }