From 207d624f5f67c73dc5e4d484f6ba484c70dc6ce8 Mon Sep 17 00:00:00 2001 From: "Roman S. Borschel" Date: Wed, 1 Sep 2010 20:43:23 +0200 Subject: [PATCH] Bumped Common dependency to RC1, fixing related issues in the test suite. --- lib/vendor/doctrine-common | 2 +- .../Tests/Models/ECommerce/ECommerceCategory.php | 8 ++++---- .../Tests/Models/ECommerce/ECommerceProduct.php | 11 +++++------ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/vendor/doctrine-common b/lib/vendor/doctrine-common index 3b5123434..0bd0fa68b 160000 --- a/lib/vendor/doctrine-common +++ b/lib/vendor/doctrine-common @@ -1 +1 @@ -Subproject commit 3b5123434e979c7adfd42061484b5a8f10a3431b +Subproject commit 0bd0fa68bbdc4d81c7742f2c972b5ed0c02b0640 diff --git a/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php b/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php index ea2ade09d..a8d8dc6bb 100644 --- a/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php +++ b/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php @@ -73,8 +73,8 @@ class ECommerceCategory public function removeProduct(ECommerceProduct $product) { $removed = $this->products->removeElement($product); - if ($removed !== null) { - $removed->removeCategory($this); + if ($removed) { + $product->removeCategory($this); } } @@ -114,8 +114,8 @@ class ECommerceCategory public function removeChild(ECommerceCategory $child) { $removed = $this->children->removeElement($child); - if ($removed !== null) { - $removed->removeParent(); + if ($removed) { + $child->removeParent(); } } diff --git a/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php b/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php index 4851778e2..75f0f17c6 100644 --- a/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php +++ b/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php @@ -112,11 +112,10 @@ class ECommerceProduct public function removeFeature(ECommerceFeature $feature) { $removed = $this->features->removeElement($feature); - if ($removed !== null) { - $removed->removeProduct(); - return true; + if ($removed) { + $feature->removeProduct(); } - return false; + return $removed; } public function addCategory(ECommerceCategory $category) @@ -130,8 +129,8 @@ class ECommerceProduct public function removeCategory(ECommerceCategory $category) { $removed = $this->categories->removeElement($category); - if ($removed !== null) { - $removed->removeProduct($this); + if ($removed) { + $category->removeProduct($this); } }