public function testGetClass() { $osRenderer = new OrderStatusRenderer(); $order = $this->getMock('Sonata\\Component\\Order\\OrderInterface'); $order->expects($this->once())->method('getStatus')->will($this->returnValue(array_rand(BaseOrder::getStatusList()))); $order->expects($this->once())->method('getDeliveryStatus')->will($this->returnValue(array_rand(BaseServiceDelivery::getStatusList()))); $order->expects($this->once())->method('getPaymentStatus')->will($this->returnValue(array_rand(BaseTransaction::getStatusList()))); $this->assertContains($osRenderer->getStatusClass($order, "", "error"), array('success', 'info', 'error')); $this->assertContains($osRenderer->getStatusClass($order, "payment", "error"), array('success', 'info', 'error')); $this->assertContains($osRenderer->getStatusClass($order, "delivery", "error"), array('success', 'info', 'error')); }
/** * @return string */ public function getDeliveryStatusName() { $statusList = BaseServiceDelivery::getStatusList(); return $statusList[$this->getDeliveryStatus()]; }
/** * return delivery status list * * @return array */ public static function getStatusList() { return BaseServiceDelivery::getStatusList(); }
public function testGetStatusList() { $statusList = array(ServiceDeliveryInterface::STATUS_OPEN => 'status_open', ServiceDeliveryInterface::STATUS_PENDING => 'status_pending', ServiceDeliveryInterface::STATUS_SENT => 'status_sent', ServiceDeliveryInterface::STATUS_CANCELLED => 'status_cancelled', ServiceDeliveryInterface::STATUS_COMPLETED => 'status_completed', ServiceDeliveryInterface::STATUS_RETURNED => 'status_returned'); $this->assertEquals($statusList, BaseDelivery::getStatusList()); $this->assertEquals($statusList, BaseServiceDelivery::getStatusList()); }