Permalink
Browse files

fix failing test due to unimplemented quantity accessors and default …

…to 1
  • Loading branch information...
cordoval authored and iampersistent committed Dec 2, 2012
1 parent 8682fa5 commit cafbbb95f1f7cc580c485f1362ce96f8ede6d5b6
Showing with 15 additions and 0 deletions.
  1. +14 −0 lib/Vespolina/Entity/Pricing/PricingContext.php
  2. +1 −0 tests/Entity/Pricing/PricingContextTest.php
@@ -25,6 +25,10 @@ public function __construct($data = array())
{
$this->data = $data;
$this->entities = array();
+
+ if ($this->getQuantity() == null) {
+ $this->setQuantity(1);
+ }
}
public function addEntity($entity)
@@ -62,4 +66,14 @@ public function getData()
{
return $this->data;
}
+
+ public function getQuantity()
+ {
+ return $this->get('quantity');
+ }
+
+ public function setQuantity($quantity)
+ {
+ $this->set('quantity', $quantity);
+ }
}
@@ -11,6 +11,7 @@ public function testConstruct()
{
$data = array(
'something' => 'nothing',
+ 'quantity' => 1
);
$context = new PricingContext($data);

0 comments on commit cafbbb9

Please sign in to comment.