/** * @covers CollectionType\Collection\CollectionAbstract::contains * @covers CollectionType\Common\ValueTypeTrait::validateValueForValueType */ public function testContainsForContainValue() { $this->collection->add('A'); $this->collection->add('B'); $this->collection->add('C'); $value = 'B'; $this->dummyType->isValid($value)->willReturn(true); $result = $this->collection->contains($value); $this->assertTrue($result); }
/** * @covers CollectionType\Collection\CollectionAbstract::contains */ public function testContainsForContainValue() { $a = new \stdClass(); $a->param = 'A'; $b = new \stdClass(); $b->param = 'B'; $c = new \stdClass(); $c->param = 'C'; $this->collection->add($a); $this->collection->add($b); $this->collection->add($c); $this->dummyType->isValid($b)->willReturn(true); $result = $this->collection->contains($b); $this->assertTrue($result); }