Dumplie\Customer\Tests\CustomerContext::orders PHP 메소드

orders() 공개 메소드

public orders ( ) : Dumplie\Customer\Domain\Orders
리턴 Dumplie\Customer\Domain\Orders
    public function orders() : Orders;

Usage Example

예제 #1
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));
 }