Permalink
Browse files

add product ValidateOptions

  • Loading branch information...
1 parent 23d5483 commit f43d2706a51ec22978c49930d54a01b0e1663a7d @iampersistent iampersistent committed Jul 15, 2012
View
9 lib/Vespolina/Entity/Product.php
@@ -332,6 +332,15 @@ public function processIdentifiers()
}
}
+ /**
+ * @inheritdoc
+ */
+ public function validateOptions(array $options)
+ {
+ // todo: actually validate, for now return true, just to prevent breaking things
+ return true;
+ }
+
protected function extractOptionCombos($optionSet)
{
if ($curSet = array_shift($optionSet)) {
View
9 lib/Vespolina/Entity/ProductInterface.php
@@ -208,4 +208,13 @@ function setType($type);
* @return type
*/
function getType();
+
+ /**
+ * Check the passed options to make sure it is a valid combination
+ *
+ * @param array $options
+ *
+ * @return boolean
+ */
+ function validateOptions(array $options);
}
View
2 tests/Entity/Order/ItemTest.php
@@ -68,7 +68,7 @@ protected function createProductOptionValidate()
{
$product = $this->getMock('Vespolina\Entity\Product');
$product->expects($this->atLeastOnce())
- ->method('validateOption')
+ ->method('validateOptions')
->will($this->returnValue(true));
return $product;

0 comments on commit f43d270

Please sign in to comment.