Exemplo n.º 1
0
 public function testExecuteDoesNotResetCheckoutIfCustomerHasMoreThanOneAddress()
 {
     $customerId = 1;
     $customerMock = $this->getMock('Magento\\Customer\\Api\\Data\\CustomerInterface');
     $customerMock->expects($this->any())->method('getId')->willReturn($customerId);
     $this->checkoutMock->expects($this->any())->method('getCustomer')->willReturn($customerMock);
     $this->mockCustomerAddressRepository($customerId, [$this->getMock('Magento\\Customer\\Api\\Data\\AddressInterface'), $this->getMock('Magento\\Customer\\Api\\Data\\AddressInterface')]);
     // check that checkout is not reset
     $this->checkoutMock->expects($this->never())->method('reset');
     $this->controller->executeInternal();
 }