示例#1
0
 public function testRender()
 {
     $address = new Address();
     $address->setFirstName('FirstName');
     $address->setLastName('LastName');
     $order = new Order();
     $order->setBillingAddress($address);
     $widget = new AddressWidget();
     $value = $widget->render(['property' => 'billingAddress'], $order);
     $this->assertEquals('FirstName LastName', $value);
 }
示例#2
0
 public function testSummaryOfTotals()
 {
     $order = new Order();
     $order->addItem($this->createItem(1000, 190));
     $order->addItem($this->createItem(2000, 380));
     $order->addAdjustment($this->createAdjustment(AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT, -500));
     $order->addAdjustment($this->createAdjustment(AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT, -500));
     $order->addAdjustment($this->createAdjustment(AdjustmentInterface::SHIPPING_ADJUSTMENT, 1200));
     $summary = $order->getShippingTotal() + $order->getDiscountTotal() + $order->getTaxTotal() + $order->getUnitPriceTotal();
     static::assertEquals(3770, $summary);
 }