Implemented test to validate if add works correct with collection attribut

This commit is contained in:
Kevin Frantz 2018-11-04 23:34:38 +01:00
parent f377fb5705
commit 3e3d9ae044

View File

@ -33,4 +33,11 @@ class CollectionAttributTest extends TestCase
$this->assertNull($this->collection->setCollection($collection)); $this->assertNull($this->collection->setCollection($collection));
$this->assertEquals($collection, $this->collection->getCollection()); $this->assertEquals($collection, $this->collection->getCollection());
} }
public function testAdd():void{
$mock = new class{};
$this->collection->setCollection(new ArrayCollection());
$this->assertTrue($this->collection->getCollection()->add($mock));
$this->assertEquals($mock, $this->collection->getCollection()->get(0));
}
} }