148 $quote = $this->_objectManager->create(Quote::class);
149 $quote->load(
'test_cart_with_configurable',
'reserved_order_id');
153 ->setAdditionalInformation(\
Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_TRANSPORT_PAYER_ID, 123);
157 $this->_objectManager->removeSharedInstance(Session::class);
158 $session = $this->_objectManager->get(Session::class);
170 'setIsLineItemsEnabled',
173 'callDoExpressCheckoutPayment',
174 'callGetExpressCheckoutDetails',
175 'getExportedBillingAddress' 178 $nvpMock = $this->getMockBuilder(Nvp::class)
179 ->setMethods($nvpMethods)
180 ->disableOriginalConstructor()
183 foreach ($nvpMethods as
$method) {
188 $apiFactoryMock = $this->getMockBuilder(ApiFactory::class)
189 ->disableOriginalConstructor()
190 ->setMethods([
'create'])
193 $apiFactoryMock->method(
'create')
195 ->willReturn($nvpMock);
197 $this->_objectManager->addSharedInstance($apiFactoryMock, ApiFactory::class);
199 $sessionMock = $this->getMockBuilder(GenericSession::class)
200 ->setMethods([
'getExpressCheckoutToken'])
201 ->setConstructorArgs(
203 $this->_objectManager->get(\
Magento\Framework\
App\Request\Http::class),
204 $this->_objectManager->get(\
Magento\Framework\Session\SidResolverInterface::class),
205 $this->_objectManager->get(\
Magento\Framework\Session\Config\ConfigInterface::class),
206 $this->_objectManager->get(\
Magento\Framework\Session\SaveHandlerInterface::class),
207 $this->_objectManager->get(\
Magento\Framework\Session\ValidatorInterface::class),
208 $this->_objectManager->get(\
Magento\Framework\Session\StorageInterface::class),
209 $this->_objectManager->get(\
Magento\Framework\Stdlib\CookieManagerInterface::class),
210 $this->_objectManager->get(\
Magento\Framework\Stdlib\Cookie\CookieMetadataFactory::class),
211 $this->_objectManager->get(\
Magento\Framework\
App\State::class),
216 $sessionMock->method(
'getExpressCheckoutToken')
219 $this->_objectManager->addSharedInstance($sessionMock, PaypalSession::class);
221 $this->dispatch(
'paypal/express/returnAction');
222 $this->
assertRedirect($this->stringContains(
'checkout/onepage/success'));
224 $this->_objectManager->removeSharedInstance(ApiFactory::class);
225 $this->_objectManager->removeSharedInstance(PaypalSession::class);
assertRedirect(\PHPUnit\Framework\Constraint\Constraint $urlConstraint=null)