public function PersistentObjectTest::testAddToManyAssociation in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php \Doctrine\Tests\Common\Persistence\PersistentObjectTest::testAddToManyAssociation()
File
- vendor/doctrine/ common/ tests/ Doctrine/ Tests/ Common/ Persistence/ PersistentObjectTest.php, line 103 
Class
- PersistentObjectTest
- @group DDC-1448
Namespace
Doctrine\Tests\Common\PersistenceCode
public function testAddToManyAssociation() {
  $child = new TestObject();
  $this->object
    ->addChildren($child);
  $this
    ->assertSame($this->object, $child
    ->getParent());
  $this
    ->assertEquals(1, count($this->object
    ->getChildren()));
  $child = new TestObject();
  $this->object
    ->addChildren($child);
  $this
    ->assertEquals(2, count($this->object
    ->getChildren()));
}