Permalink
Browse files

Added order date field, the date when the order was made (might be di…

…fferent from the order create date)
  • Loading branch information...
1 parent 05838f8 commit 0290d2f6cea74f91e6d5657b131b635ff360bcbd @inspiran inspiran committed with iampersistent Feb 22, 2013
@@ -18,6 +18,7 @@ class Order extends BaseOrder implements OrderInterface
const STATE_EXPIRED = 'expired'; //Unprocessed and expired
protected $followUp;
+ protected $orderDate;
protected $paymentInstruction;
protected $billingAgreements;
@@ -73,6 +74,16 @@ public function setFollowUp($followUp)
$this->followUp = $followUp;
}
+ public function setOrderDate(\DateTime $orderDate)
+ {
+ $this->orderDate = $orderDate;
+ }
+
+ public function getOrderDate()
+ {
+ return $this->orderDate;
+ }
+
/**
* @inheritdoc
*/
@@ -12,7 +12,7 @@
use Vespolina\Entity\Partner\PartnerInterface;
/**
- * OrderInterface is a generic interface for shopping cart or sales order
+ * OrderInterface is a generic interface for a shopping cart or sales order
*
* @author Daniel Kucharski <daniel@xerias.be>
* @author Richard Shank <develop@zestic.com>
@@ -0,0 +1,21 @@
+<?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.
+ */
+
+use Vespolina\Entity\Order\Order;
+
+class OrderTest extends \PHPUnit_Framework_TestCase
+{
+ public function testOrderDate()
+ {
+ $order = new Order();
+ $now = new \DateTime();
+ $order->setOrderDate($now);
+ $this->assertEquals($now, $order->getOrderDate());
+ }
+
+}
@@ -12,7 +12,7 @@ public function testAddElements()
$this->assertGreaterThan(0, $pricingElementsCount, 'there should be at least one default element');
- $element1 = new PricingElement();
+ $element1 = new PricingElement();
$pricingSet->addPricingElement($element1);
$pricingElementsCount++;
$this->assertEquals($pricingElementsCount, count($pricingSet->getPricingElements()));

0 comments on commit 0290d2f

Please sign in to comment.