File tree 4 files changed +9
-9
lines changed
app/code/Magento/Checkout
Test/Unit/Controller/Cart
dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files
4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 7
7
8
8
/**
9
9
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
10
+ *
11
+ * Coupon Post controller.
10
12
*/
11
13
class CouponPost extends \Magento \Checkout \Controller \Cart
12
14
{
Original file line number Diff line number Diff line change 8
8
use Magento \Checkout \Controller \Cart \Index ;
9
9
10
10
/**
11
- * Class IndexTest
12
- *
13
11
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
12
+ *
13
+ * Test for \Magento\Checkout\Controller\Cart\CouponPost
14
14
*/
15
15
class CouponPostTest extends \PHPUnit_Framework_TestCase
16
16
{
Original file line number Diff line number Diff line change 18
18
19
19
/** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
20
20
$ attribute = Bootstrap::getObjectManager ()->create (
21
- ' Magento\Catalog\Model\ResourceModel\Eav\Attribute '
21
+ \ Magento \Catalog \Model \ResourceModel \Eav \Attribute::class
22
22
);
23
23
24
24
/** @var AttributeRepositoryInterface $attributeRepository */
Original file line number Diff line number Diff line change 8
8
9
9
require __DIR__ . '/configurable_products.php ' ;
10
10
11
+ $ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
12
+
11
13
/** @var \Magento\Quote\Model\Quote $quote */
12
14
$ quote = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (\Magento \Quote \Model \Quote::class);
13
15
55
57
);
56
58
57
59
/** @var \Magento\Quote\Model\QuoteRepository $quoteRepository */
58
- $ quoteRepository = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
59
- \Magento \Quote \Model \QuoteRepository::class
60
- );
60
+ $ quoteRepository = $ objectManager ->create (\Magento \Quote \Model \QuoteRepository::class);
61
61
$ quote ->collectTotals ();
62
62
$ quoteRepository ->save ($ quote );
63
63
64
64
/** @var \Magento\Checkout\Model\Session $session */
65
- $ session = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
66
- \Magento \Checkout \Model \Session::class
67
- );
65
+ $ session = $ objectManager ->create (\Magento \Checkout \Model \Session::class);
68
66
$ session ->setQuoteId ($ quote ->getId ());
You can’t perform that action at this time.
0 commit comments