You are here

public function PersistentObjectTest::testAddToManyAssociation in Plug 7

File

lib/doctrine/common/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php, line 103

Class

PersistentObjectTest
@group DDC-1448

Namespace

Doctrine\Tests\Common\Persistence

Code

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()));
}