1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +03:00

[2.0] Simplifying code. Including OneToManyBidirectionalAssociation test in AllTests

This commit is contained in:
romanb 2009-07-01 13:45:31 +00:00
parent 5bbc2a9e58
commit 5b67754595
2 changed files with 5 additions and 6 deletions

View file

@ -89,12 +89,10 @@ class ECommerceProduct
} }
public function removeFeature(ECommerceFeature $feature) { public function removeFeature(ECommerceFeature $feature) {
foreach ($this->features as $index => $current) { $removed = $this->features->removeElement($feature);
if ($current === $feature) { if ($removed !== null) {
unset($this->features[$index]); $removed->removeProduct();
$current->removeProduct(); return true;
return true;
}
} }
return false; return false;
} }

View file

@ -28,6 +28,7 @@ class AllTests
$suite->addTestSuite('Doctrine\Tests\ORM\Functional\QueryTest'); $suite->addTestSuite('Doctrine\Tests\ORM\Functional\QueryTest');
$suite->addTestSuite('Doctrine\Tests\ORM\Functional\OneToOneUnidirectionalAssociationTest'); $suite->addTestSuite('Doctrine\Tests\ORM\Functional\OneToOneUnidirectionalAssociationTest');
$suite->addTestSuite('Doctrine\Tests\ORM\Functional\OneToOneBidirectionalAssociationTest'); $suite->addTestSuite('Doctrine\Tests\ORM\Functional\OneToOneBidirectionalAssociationTest');
$suite->addTestSuite('Doctrine\Tests\ORM\Functional\OneToManyBidirectionalAssociationTest');
return $suite; return $suite;
} }