/** * @param ChainOfResponsibility\Order $order * @return string */ public function sendNotification(ChainOfResponsibility\Order $order) { return sprintf('Dear %s %s, thank you for your order (id: %d). We will ship it shortly!', $order->getCustomerFirstName(), $order->getCustomerLastName(), $order->getUid()); }
/** * @param ChainOfResponsibility\Order $order * @return string */ public function sendNotification(ChainOfResponsibility\Order $order) { return sprintf('Dear %s %s, your order has been shipped! Your tracking number: %s', $order->getCustomerFirstName(), $order->getCustomerLastName(), $order->getTrackingNumber()); }
/** * There is no responsibility set for a canceled order. * No notification will be sent. */ public function testCanceledOrderNotification() { $order = new ChainOfResponsibility\Order(34541, 'Denzel', 'Washington'); $order->setStatus(ChainOfResponsibility\Order::ORDER_STATUS_CANCELED); $this->assertSame('', $this->chainOfResponsibility->handleOrder($order)); }