@@ -39,7 +39,8 @@ protected function setUp()
3939 {
4040 $ this ->objectManager = Bootstrap::getObjectManager ();
4141 $ this ->getMaskedQuoteIdByReservedOrderId = $ this ->objectManager ->get (GetMaskedQuoteIdByReservedOrderId::class);
42- $ this ->getCustomOptionsValuesForQueryBySku = $ this ->objectManager ->get (GetCustomOptionsValuesForQueryBySku::class);
42+ $ this ->getCustomOptionsValuesForQueryBySku =
43+ $ this ->objectManager ->get (GetCustomOptionsValuesForQueryBySku::class);
4344 }
4445
4546 /**
@@ -65,7 +66,8 @@ public function testAddDownloadableProductWithOptions()
6566 $ response = $ this ->graphQlMutation ($ query );
6667 self ::assertArrayHasKey ('items ' , $ response ['addDownloadableProductsToCart ' ]['cart ' ]);
6768 self ::assertCount ($ qty , $ response ['addDownloadableProductsToCart ' ]['cart ' ]);
68- $ customizableOptionsOutput = $ response ['addDownloadableProductsToCart ' ]['cart ' ]['items ' ][0 ]['customizable_options ' ];
69+ $ customizableOptionsOutput =
70+ $ response ['addDownloadableProductsToCart ' ]['cart ' ]['items ' ][0 ]['customizable_options ' ];
6971 $ assignedOptionsCount = count ($ customOptionsValues );
7072 for ($ counter = 0 ; $ counter < $ assignedOptionsCount ; $ counter ++) {
7173 $ expectedValues = $ this ->buildExpectedValuesArray ($ customOptionsValues [$ counter ]['value_string ' ]);
@@ -79,9 +81,6 @@ public function testAddDownloadableProductWithOptions()
7981 /**
8082 * @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable_with_custom_options.php
8183 * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
82- *
83- * @expectedException \Exception
84- * @expectedExceptionMessage The product's required option(s) weren't entered. Make sure the options are entered and try again.
8584 */
8685 public function testAddDownloadableProductWithMissedRequiredOptionsSet ()
8786 {
@@ -95,6 +94,11 @@ public function testAddDownloadableProductWithMissedRequiredOptionsSet()
9594
9695 $ query = $ this ->getQuery ($ maskedQuoteId , $ qty , $ sku , $ customizableOptions , $ linkId );
9796
97+ $ this ->expectException (\Exception::class);
98+ $ this ->expectExceptionMessage (
99+ 'The product \'s required option(s) weren \'t entered. Make sure the options are entered and try again. '
100+ );
101+
98102 $ this ->graphQlMutation ($ query );
99103 }
100104
@@ -148,8 +152,13 @@ private function buildExpectedValuesArray(string $assignedValue) : array
148152 * @param $linkId
149153 * @return string
150154 */
151- private function getQuery (string $ maskedQuoteId , int $ qty , string $ sku , string $ customizableOptions , $ linkId ): string
152- {
155+ private function getQuery (
156+ string $ maskedQuoteId ,
157+ int $ qty ,
158+ string $ sku ,
159+ string $ customizableOptions ,
160+ $ linkId
161+ ): string {
153162 $ query = <<<MUTATION
154163mutation {
155164 addDownloadableProductsToCart(
0 commit comments