checkouts() public method

public checkouts ( ) : Dumplie\Customer\Domain\Checkouts
return Dumplie\Customer\Domain\Checkouts
示例#1
0
 function test_change_billing_address()
 {
     $cartId = $this->customerContext->createEmptyCart();
     $command = new NewCheckout((string) $cartId, "Norbert Orzechowicz", "ul. FLorianska 1", "30-300", "Kraków", "PL");
     $this->customerContext->commandBus()->handle($command);
     $changeBillingAddress = new ChangeBillingAddress((string) $cartId, "Lesze Prabucki", "ul. Rynek 2", "40-400", "Gdańsk", "PL");
     $this->customerContext->commandBus()->handle($changeBillingAddress);
     $this->clear();
     $this->assertEquals("Lesze Prabucki, 40-400 Gdańsk, ul. Rynek 2, PL", (string) $this->customerContext->checkouts()->getForCart($cartId)->billingAddress());
 }
示例#2
0
 function test_placing_new_order()
 {
     $cartId = $this->customerContext->createNewCartWithProducts('EUR', ['SKU_1', 'SKU_2']);
     $this->customerContext->checkout($cartId);
     $orderId = OrderId::generate();
     $placeOrderCommand = new PlaceOrder((string) $cartId, (string) $orderId);
     $this->customerContext->commandBus()->handle($placeOrderCommand);
     $this->clear();
     $this->assertFalse($this->customerContext->carts()->exists($cartId));
     $this->assertFalse($this->customerContext->checkouts()->existsForCart($cartId));
     $this->assertTrue($this->customerContext->orders()->exists($orderId));
 }