Пример #1
0
 public function testManyToOneAssociationWorks()
 {
     $testCase = new TestsCases\BaseTestCase();
     $associatedTestCase = new TestsCases\AssociationTestCase();
     $testCase->addInvertedManyToOnePropertyItem(new TestsCases\AssociationTestCase());
     $testCase->addInvertedManyToOnePropertyItem($associatedTestCase);
     $this->assertEquals($testCase, $associatedTestCase->getMappedManyToOneProperty());
     $testCase->removeInvertedManyToOnePropertyItem($associatedTestCase);
     $this->assertEquals(null, $associatedTestCase->getMappedManyToOneProperty());
     $this->assertEquals(1, count($testCase->getInvertedManyToOnePropertyItems()));
 }