Permalink
Browse files

remove option functionality except set and clear. It doesn't make sen…

…se to partially set options and it also prevents option validation
  • Loading branch information...
1 parent 0359964 commit 65f9339a6c3455a2c855c161a5e7e33d398c49c5 @iampersistent iampersistent committed Jul 15, 2012
Showing with 15 additions and 11 deletions.
  1. +14 −0 lib/Vespolina/Entity/Exception/InvalidOptionsException.php
  2. +1 −11 tests/Entity/Order/ItemTest.php
View
14 lib/Vespolina/Entity/Exception/InvalidOptionsException.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * (c) 2012 Vespolina Project http://www.vespolina-project.org
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace Vespolina\Entity\Exception;
+
+class InvalidOptionsException extends \Exception
+{
+
+}
View
12 tests/Entity/Order/ItemTest.php
@@ -54,7 +54,7 @@ public function testOptionMethods()
$this->assertEmpty($item->getOptions());
$rmSetProduct->invokeArgs($item, array($this->createProductOptionValidate(false)));
- $this->setExpectedException('Vespolina\Exception\InvalidOptionsException');
+ $this->setExpectedException('Vespolina\Entity\Exception\InvalidOptionsException');
$rmSetOptions->invokeArgs($item, array('failure' => 0));
$this->assertEmpty($item->getOptions(), 'nothing should be added if the validation fails');
}
@@ -68,14 +68,4 @@ protected function createProductOptionValidate($returns = true)
return $product;
}
-
- protected function createProductOptionValidate()
- {
- $product = $this->getMock('Vespolina\Entity\Product');
- $product->expects($this->atLeastOnce())
- ->method('validateOptions')
- ->will($this->returnValue(true));
-
- return $product;
- }
}

0 comments on commit 65f9339

Please sign in to comment.