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();
 }
 /**
  * {@inheritdoc}
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch');
     if (!$pluginInfo) {
         return parent::dispatch($request);
     } else {
         return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo);
     }
 }