/** * @covers CollectionType\Map\MapAbstract::removeValueAll * @covers CollectionType\Map\MapAbstract::containsAll * @covers CollectionType\Map\MapAbstract::validateKeyType * @covers CollectionType\Map\MapAbstract::validateValueType * @covers CollectionType\Map\MapAbstract::__construct */ public function testRemoveValueAllWhenMapContainsAllElementsForReturnedValues() { $otherMap = new MapAbstractFake($this->dummyKeyType->reveal(), $this->dummyValueType->reveal()); $key1 = new \stdClass(); $key1->param = 'key1'; $value1 = new \stdClass(); $value1->param = 'value1'; $this->dummyKeyType->isValid($key1)->willReturn(true); $this->dummyValueType->isValid($value1)->willReturn(true); $this->map->put($key1, $value1); $otherMap->put($key1, $value1); $key2 = new \stdClass(); $key2->param = 'key2'; $value2 = new \stdClass(); $value2->param = 'value2'; $this->dummyKeyType->isValid($key2)->willReturn(true); $this->dummyValueType->isValid($value2)->willReturn(true); $this->map->put($key2, $value2); $otherMap->put($key2, $value2); $key3 = new \stdClass(); $key3->param = 'key3'; $value3 = new \stdClass(); $value3->param = 'value3'; $this->dummyKeyType->isValid($key3)->willReturn(true); $this->dummyValueType->isValid($value3)->willReturn(true); $this->map->put($key3, $value3); $this->map->removeValueAll($otherMap); $result = $this->map->values(); $this->assertEquals([$value3], $result); }