action order tests

This commit is contained in:
Etienne Roudeix
2013-09-23 14:44:52 +02:00
parent 194073fa42
commit 5bbf693e0f
4 changed files with 243 additions and 34 deletions

View File

@@ -144,6 +144,7 @@ class Order extends BaseAction implements EventSubscriberInterface
->setAddress3($deliveryAddress->getAddress3())
->setZipcode($deliveryAddress->getZipcode())
->setCity($deliveryAddress->getCity())
->setPhone($deliveryAddress->getPhone())
->setCountryId($deliveryAddress->getCountryId())
->save($con)
;
@@ -159,6 +160,7 @@ class Order extends BaseAction implements EventSubscriberInterface
->setAddress3($invoiceAddress->getAddress3())
->setZipcode($invoiceAddress->getZipcode())
->setCity($invoiceAddress->getCity())
->setPhone($invoiceAddress->getPhone())
->setCountryId($invoiceAddress->getCountryId())
->save($con)
;
@@ -284,20 +286,6 @@ class Order extends BaseAction implements EventSubscriberInterface
/* @todo */
}
/**
* @param \Thelia\Core\Event\OrderEvent $event
*/
public function setReference(OrderEvent $event)
{
$event->getOrder()->setRef($this->generateRef());
}
public function generateRef()
{
/* order addresses are unique */
return uniqid('ORD', true);
}
/**
* Returns an array of event names this subscriber wants to listen to.
*
@@ -326,7 +314,6 @@ class Order extends BaseAction implements EventSubscriberInterface
TheliaEvents::ORDER_SET_INVOICE_ADDRESS => array("setInvoiceAddress", 128),
TheliaEvents::ORDER_SET_PAYMENT_MODULE => array("setPaymentModule", 128),
TheliaEvents::ORDER_PAY => array("create", 128),
TheliaEvents::ORDER_BEFORE_CREATE => array("setReference", 128),
TheliaEvents::ORDER_BEFORE_PAYMENT => array("sendOrderEmail", 128),
);
}