1
0
mirror of synced 2024-12-13 06:46:03 +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) {
foreach ($this->features as $index => $current) {
if ($current === $feature) {
unset($this->features[$index]);
$current->removeProduct();
return true;
}
$removed = $this->features->removeElement($feature);
if ($removed !== null) {
$removed->removeProduct();
return true;
}
return false;
}

View File

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