/** * {@inheritdoc} */ public function getCheckout() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getCheckout'); if (!$pluginInfo) { return parent::getCheckout(); } else { return $this->___callPlugins('getCheckout', func_get_args(), $pluginInfo); } }
/** * @magentoAppIsolation enabled * @magentoDataFixture Magento/Customer/_files/customer.php */ public function testInitCheckoutLoggedIn() { $this->_model->saveBilling($this->_getCustomerData(), null); $this->_prepareQuote($this->_getQuote()); $customerIdFromFixture = 1; $emailFromFixture = '*****@*****.**'; /** @var $customerSession \Magento\Customer\Model\Session*/ $customerSession = Bootstrap::getObjectManager()->create('Magento\\Customer\\Model\\Session'); /** @var $customerRepository \Magento\Customer\Api\CustomerRepositoryInterface */ $customerRepository = Bootstrap::getObjectManager()->create('Magento\\Customer\\Api\\CustomerRepositoryInterface'); $customerData = $customerRepository->getById($customerIdFromFixture); $customerSession->setCustomerDataObject($customerData); $this->_model = Bootstrap::getObjectManager()->create('Magento\\Checkout\\Model\\Type\\Onepage', ['customerSession' => $customerSession]); $this->assertTrue($this->_model->getCheckout()->getSteps()['shipping']['allow']); $this->assertTrue($this->_model->getCheckout()->getSteps()['billing']['allow']); $this->_model->initCheckout(); $this->assertFalse($this->_model->getCheckout()->getSteps()['shipping']['allow']); //When the user is logged in and for Step billing - allow is not reset to true $this->assertTrue($this->_model->getCheckout()->getSteps()['billing']['allow']); $this->assertEquals($emailFromFixture, $this->_model->getQuote()->getCustomer()->getEmail()); }