Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 0290d2f6cea74f91e6d5657b131b635ff360bcbd 1 parent 05838f8
@inspiran inspiran authored iampersistent committed
View
11 lib/Vespolina/Entity/Order/Order.php
@@ -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
*/
View
2  lib/Vespolina/Entity/Order/OrderInterface.php
@@ -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>
View
21 tests/Entity/Order/OrderTest.php
@@ -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());
+ }
+
+}
View
2  tests/Entity/Pricing/PricingSetTest.php
@@ -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()));
Please sign in to comment.
Something went wrong with that request. Please try again.