Skip to content

Commit 64a7430

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into publication
Conflicts: dev/tests/integration/testsuite/Magento/Multishipping/Controller/CheckoutTest.php
2 parents 530f81d + d473ce1 commit 64a7430

File tree

1 file changed

+36
-24
lines changed
  • dev/tests/integration/testsuite/Magento/Multishipping/Controller

1 file changed

+36
-24
lines changed

dev/tests/integration/testsuite/Magento/Multishipping/Controller/CheckoutTest.php

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,65 @@
55
*/
66
namespace Magento\Multishipping\Controller;
77

8-
use Magento\TestFramework\Helper\Bootstrap;
8+
use \Magento\Multishipping\Model\Checkout\Type\Multishipping\State;
99

1010
/**
1111
* Test class for \Magento\Multishipping\Controller\Checkout
1212
*
1313
* @magentoAppArea frontend
14+
* @magentoDataFixture Magento/Sales/_files/quote.php
15+
* @magentoDataFixture Magento/Customer/_files/customer.php
1416
*/
1517
class CheckoutTest extends \Magento\TestFramework\TestCase\AbstractController
1618
{
1719
/**
18-
* Covers app/code/Magento/Checkout/Block/Multishipping/Payment/Info.php
19-
* and app/code/Magento/Checkout/Block/Multishipping/Overview.php
20+
* @var \Magento\Quote\Model\Quote
21+
*/
22+
protected $quote;
23+
24+
/**
25+
* @var \Magento\Checkout\Model\Session
26+
*/
27+
protected $checkoutSession;
28+
29+
/**
30+
* @inheritdoc
31+
*/
32+
public function setUp()
33+
{
34+
parent::setUp();
35+
$this->quote = $this->_objectManager->create('Magento\Quote\Model\Quote');
36+
$this->checkoutSession = $this->_objectManager->get('Magento\Checkout\Model\Session');
37+
38+
$this->quote->load('test01', 'reserved_order_id');
39+
$this->checkoutSession->setQuoteId($this->quote->getId());
40+
$this->checkoutSession->setCartWasUpdated(false);
41+
}
42+
43+
/**
44+
* Covers \Magento\Multishipping\Block\Checkout\Payment\Info and \Magento\Multishipping\Block\Checkout\Overview
2045
*
21-
* @magentoDataFixture Magento/Sales/_files/quote.php
22-
* @magentoDataFixture Magento/Customer/_files/customer.php
2346
* @magentoConfigFixture current_store multishipping/options/checkout_multiple 1
2447
*/
2548
public function testOverviewAction()
2649
{
27-
$this->markTestSkipped('Skipped due to fails on Travis CI (MAGETWO-35405)');
28-
29-
/** @var $quote \Magento\Quote\Model\Quote */
30-
$quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Quote\Model\Quote');
31-
$quote->load('test01', 'reserved_order_id');
32-
33-
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Checkout\Model\Session')
34-
->setQuoteId($quote->getId());
35-
50+
/** @var \Magento\Framework\Data\Form\FormKey $formKey */
3651
$formKey = $this->_objectManager->get('Magento\Framework\Data\Form\FormKey');
3752
$logger = $this->getMock('Psr\Log\LoggerInterface', [], [], '', false);
38-
39-
/** @var $session \Magento\Customer\Model\Session */
40-
$session = Bootstrap::getObjectManager()->create('Magento\Customer\Model\Session', [$logger]);
41-
42-
/** @var \Magento\Customer\Api\AccountManagementInterface $service */
43-
$service = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
44-
->create('Magento\Customer\Api\AccountManagementInterface');
53+
/** @var \Magento\Customer\Api\AccountManagementInterface $service */
54+
$service = $this->_objectManager->create('Magento\Customer\Api\AccountManagementInterface');
4555
$customer = $service->authenticate('[email protected]', 'password');
46-
47-
$session->setCustomerDataAsLoggedIn($customer);
56+
/** @var \Magento\Customer\Model\Session $customerSession */
57+
$customerSession = $this->_objectManager->create('Magento\Customer\Model\Session', [$logger]);
58+
$customerSession->setCustomerDataAsLoggedIn($customer);
59+
$this->checkoutSession->setCheckoutState(State::STEP_BILLING);
4860
$this->getRequest()->setPostValue('payment', ['method' => 'checkmo']);
4961
$this->dispatch('multishipping/checkout/overview');
5062
$html = $this->getResponse()->getBody();
5163
$this->assertContains('<div class="box box-billing-method">', $html);
5264
$this->assertContains('<div class="box box-shipping-method">', $html);
5365
$this->assertContains(
54-
'<dt class="title">' . $quote->getPayment()->getMethodInstance()->getTitle() . '</dt>',
66+
'<dt class="title">' . $this->quote->getPayment()->getMethodInstance()->getTitle() . '</dt>',
5567
$html
5668
);
5769
$this->assertContains('<span class="price">$10.00</span>', $html);

0 commit comments

Comments
 (0)