Skip to content

Commit 7750077

Browse files
committed
ACPT-1625
1 parent 225d15e commit 7750077

File tree

5 files changed

+63
-62
lines changed

5 files changed

+63
-62
lines changed

dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCheckoutMutationsStateTest.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\GraphQl\App;
99

1010
use Magento\Catalog\Api\ProductRepositoryInterface;
11+
use Magento\Framework\Data\Graph;
1112
use Magento\GraphQl\App\State\GraphQlStateDiff;
1213

1314
/**
@@ -23,7 +24,7 @@ class GraphQlCheckoutMutationsStateTest extends \PHPUnit\Framework\TestCase
2324
/**
2425
* @var GraphQlStateDiff
2526
*/
26-
private $graphQlStateDiff;
27+
private ?GraphQlStateDiff $graphQlStateDiff = null;
2728

2829
/**
2930
* @inheritDoc
@@ -40,13 +41,13 @@ protected function setUp(): void
4041
protected function tearDown(): void
4142
{
4243
$this->graphQlStateDiff->tearDown();
44+
$this->graphQlStateDiff = null;
4345
parent::tearDown();
4446
}
4547

4648

4749
/**
4850
* @return void
49-
* @throws \Exception
5051
*/
5152
public function testCreateEmptyCart() : void
5253
{
@@ -66,7 +67,6 @@ public function testCreateEmptyCart() : void
6667
* @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
6768
* @magentoDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
6869
* @return void
69-
* @throws \Exception
7070
*/
7171
public function testAddSimpleProductToCart()
7272
{
@@ -90,7 +90,6 @@ public function testAddSimpleProductToCart()
9090
* @magentoDataFixture Magento/SalesRule/_files/coupon_code_with_wildcard.php
9191
* @magentoDataFixture Magento/SalesRule/_files/coupon_cart_fixed_discount.php
9292
* @return void
93-
* @throws \Exception
9493
*/
9594
public function testAddCouponToCart()
9695
{
@@ -112,7 +111,6 @@ public function testAddCouponToCart()
112111
* @magentoDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
113112
* @magentoDataFixture Magento/GraphQl/Catalog/_files/virtual_product.php
114113
* @return void
115-
* @throws \Exception
116114
*/
117115
public function testAddVirtualProductToCart()
118116
{
@@ -580,10 +578,7 @@ private function getAddBundleProductToCartQuery(string $cartId, string $sku)
580578

581579

582580
/**
583-
* @param string $cartId
584-
* @param float $qty
585-
* @param string $sku
586-
* @return void
581+
* @return string
587582
*/
588583
private function getAddProductToCartQuery(): string
589584
{
@@ -616,9 +611,6 @@ private function getAddProductToCartQuery(): string
616611
}
617612

618613
/**
619-
* @param string $maskedQuoteId
620-
* @param string $sku
621-
* @param float $quantity
622614
* @return string
623615
*/
624616
private function getAddVirtualProductToCartQuery(): string
@@ -653,10 +645,7 @@ private function getAddVirtualProductToCartQuery(): string
653645
}
654646

655647
/**
656-
* Queries, variables, operation names, and expected responses for test
657-
*
658648
* @return string
659-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
660649
*/
661650
private function getEmptyCart(): string
662651
{
@@ -667,6 +656,9 @@ private function getEmptyCart(): string
667656
QUERY;
668657
}
669658

659+
/**
660+
* @return string
661+
*/
670662
private function getShippingMethodsQuery()
671663
{
672664
return <<<'QUERY'
@@ -699,6 +691,9 @@ private function getShippingMethodsQuery()
699691

700692
}
701693

694+
/**
695+
* @return string
696+
*/
702697
private function getPaymentMethodQuery()
703698
{
704699
return <<<'QUERY'
@@ -723,6 +718,9 @@ private function getPaymentMethodQuery()
723718
QUERY;
724719
}
725720

721+
/**
722+
* @return string
723+
*/
726724
private function getPlaceOrderQuery(): string
727725
{
728726
return <<<'QUERY'
@@ -740,6 +738,9 @@ private function getPlaceOrderQuery(): string
740738
QUERY;
741739
}
742740

741+
/**
742+
* @return string
743+
*/
743744
private function getAddCouponToCartQuery(): string
744745
{
745746
return <<<'QUERY'

dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlCustomerMutationsTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
class GraphQlCustomerMutationsTest extends \PHPUnit\Framework\TestCase
2525
{
2626
/**
27-
* @var GraphQlStateDiff
27+
* @var GraphQlStateDiff|null
2828
*/
29-
private $graphQlStateDiff;
29+
private ?GraphQlStateDiff $graphQlStateDiff = null;
3030

3131
/**
3232
* @inheritDoc
@@ -43,6 +43,7 @@ protected function setUp(): void
4343
protected function tearDown(): void
4444
{
4545
$this->graphQlStateDiff->tearDown();
46+
$this->graphQlStateDiff = null;
4647
parent::tearDown();
4748
}
4849

@@ -51,7 +52,6 @@ protected function tearDown(): void
5152
* @magentoDataFixture Magento/Customer/_files/customer_address.php
5253
* @dataProvider customerDataProvider
5354
* @return void
54-
* @throws \Exception
5555
*/
5656
public function testCustomerState(
5757
string $query,
@@ -136,8 +136,6 @@ public function testRequestPasswordResetEmail(): void
136136
/**
137137
* @magentoDataFixture Magento/Customer/_files/customer.php
138138
* @return void
139-
* @throws LocalizedException
140-
* @throws NoSuchEntityException
141139
*/
142140
public function testResetPassword(): void
143141
{
@@ -158,8 +156,6 @@ public function testResetPassword(): void
158156
/**
159157
* @magentoDataFixture Magento/Customer/_files/customer.php
160158
* @return void
161-
* @throws LocalizedException
162-
* @throws NoSuchEntityException
163159
*/
164160
public function testChangePassword(): void
165161
{

dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ class GraphQlStateTest extends \PHPUnit\Framework\TestCase
2525
*/
2626
private $getMaskedQuoteIdByReservedOrderId;
2727

28-
private $graphQlStateDiff;
28+
/**
29+
* @var GraphQlStateDiff|null
30+
*/
31+
private ?GraphQlStateDiff $graphQlStateDiff;
2932

3033
/**
3134
* @inheritDoc
@@ -42,6 +45,7 @@ protected function setUp(): void
4245
protected function tearDown(): void
4346
{
4447
$this->graphQlStateDiff->tearDown();
48+
$this->graphQlStateDiff = null;
4549
parent::tearDown();
4650
}
4751

dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class GraphQlStateDiff
3333
private const CONTENT_TYPE = 'application/json';
3434

3535
/** @var ObjectManagerInterface */
36-
private ObjectManagerInterface $objectManagerBeforeTest;
36+
private readonly ObjectManagerInterface $objectManagerBeforeTest;
3737

3838
/** @var ObjectManager */
39-
private ObjectManager $objectManagerForTest;
39+
private readonly ObjectManager $objectManagerForTest;
4040

4141
/** @var Comparator */
42-
private Comparator $comparator;
42+
private readonly Comparator $comparator;
4343

4444
public function __construct()
4545
{

dev/tests/integration/testsuite/Magento/GraphQl/App/State/ObjectManager.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,43 @@ class ObjectManager extends TestFrameworkObjectManager
2323
*/
2424
private $bootstrappedObjects = [
2525
// Note: These are after $objectManager = $this->_factory->create($overriddenParams);
26-
'Magento\\Framework\\App\\DeploymentConfig',
27-
'Magento\\Framework\\App\\Filesystem\\DirectoryList',
28-
'Magento\\Framework\\Filesystem\\DirectoryList',
29-
'Magento\\Framework\\Filesystem\\DriverPool',
30-
'Magento\\Framework\\ObjectManager\\RelationsInterface',
31-
'Magento\\Framework\\Interception\\DefinitionInterface',
32-
'Magento\\Framework\\ObjectManager\\ConfigInterface',
33-
'Magento\\Framework\\Interception\\ObjectManager\\ConfigInterface',
34-
'Magento\\Framework\\ObjectManager\\DefinitionInterface',
35-
'Magento\\Framework\\Stdlib\\BooleanUtils',
36-
'Magento\\Framework\\ObjectManager\\Config\\Mapper\\Dom',
37-
'Magento\\Framework\\ObjectManager\\ConfigLoaderInterface',
38-
'Magento\\TestFramework\\ObjectManager\\Config',
39-
'Magento\\Framework\\ObjectManagerInterface',
40-
'Magento\\RemoteStorage\\Model\\Config',
41-
'Magento\\RemoteStorage\\Driver\\Adapter\\MetadataProviderInterfaceFactory',
42-
'Magento\\RemoteStorage\\Driver\\Adapter\\Cache\\CacheInterfaceFactory',
43-
'Magento\\RemoteStorage\\Driver\\Adapter\\CachedAdapterInterfaceFactory',
44-
'Magento\\Framework\\App\\Cache\\Proxy',
45-
'Aws\\Credentials\\CredentialsFactory',
46-
'Magento\\Framework\\Serialize\\Serializer\\Json',
47-
'Magento\\AwsS3\\Driver\\CredentialsCache',
48-
'Magento\\AwsS3\\Driver\\CachedCredentialsProvider',
49-
'Magento\\AwsS3\\Driver\\AwsS3Factory',
50-
'Magento\\RemoteStorage\\Driver\\DriverFactoryPool',
51-
'Magento\\RemoteStorage\\Driver\\DriverPool',
26+
'Magento\Framework\App\DeploymentConfig',
27+
'Magento\Framework\App\Filesystem\DirectoryList',
28+
'Magento\Framework\Filesystem\DirectoryList',
29+
'Magento\Framework\Filesystem\DriverPool',
30+
'Magento\Framework\ObjectManager\RelationsInterface',
31+
'Magento\Framework\Interception\DefinitionInterface',
32+
'Magento\Framework\ObjectManager\ConfigInterface',
33+
'Magento\Framework\Interception\ObjectManager\ConfigInterface',
34+
'Magento\Framework\ObjectManager\DefinitionInterface',
35+
'Magento\Framework\Stdlib\BooleanUtils',
36+
'Magento\Framework\ObjectManager\Config\Mapper\Dom',
37+
'Magento\Framework\ObjectManager\ConfigLoaderInterface',
38+
'Magento\TestFramework\ObjectManager\Config',
39+
'Magento\Framework\ObjectManagerInterface',
40+
'Magento\RemoteStorage\Model\Config',
41+
'Magento\RemoteStorage\Driver\Adapter\MetadataProviderInterfaceFactory',
42+
'Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterfaceFactory',
43+
'Magento\RemoteStorage\Driver\Adapter\CachedAdapterInterfaceFactory',
44+
'Magento\Framework\App\Cache\Proxy',
45+
'Aws\Credentials\CredentialsFactory',
46+
'Magento\Framework\Serialize\Serializer\Json',
47+
'Magento\AwsS3\Driver\CredentialsCache',
48+
'Magento\AwsS3\Driver\CachedCredentialsProvider',
49+
'Magento\AwsS3\Driver\AwsS3Factory',
50+
'Magento\RemoteStorage\Driver\DriverFactoryPool',
51+
'Magento\RemoteStorage\Driver\DriverPool',
5252
'remoteReadFactory',
53-
'Magento\\RemoteStorage\\Model\\Filesystem\\Directory\\WriteFactory',
53+
'Magento\RemoteStorage\Model\Filesystem\Directory\WriteFactory',
5454
'customRemoteFilesystem',
55-
'Magento\\Framework\\App\\ResourceConnection\\Proxy',
56-
'Magento\\Framework\\App\\Cache\\Frontend\\Factory',
57-
'Magento\\Framework\\App\\Cache\\Frontend\\Pool',
58-
'Magento\\Framework\\App\\Cache\\Type\\FrontendPool',
59-
'Magento\\Framework\\App\\Cache\\Type\\Config',
60-
'Magento\\Framework\\ObjectManager\\Config\\Reader\\DomFactory',
61-
'Magento\\Framework\\Serialize\\Serializer\\Serialize',
62-
'Magento\\Framework\\App\\ObjectManager\\ConfigLoader',
55+
'Magento\Framework\App\ResourceConnection\Proxy',
56+
'Magento\Framework\App\Cache\Frontend\Factory',
57+
'Magento\Framework\App\Cache\Frontend\Pool',
58+
'Magento\Framework\App\Cache\Type\FrontendPool',
59+
'Magento\Framework\App\Cache\Type\Config',
60+
'Magento\Framework\ObjectManager\Config\Reader\DomFactory',
61+
'Magento\Framework\Serialize\Serializer\Serialize',
62+
'Magento\Framework\App\ObjectManager\ConfigLoader',
6363
// Note: These were added by addSharedInstance
6464
'Magento\Framework\App\Filesystem\DirectoryList',
6565
'Magento\Framework\Filesystem\DirectoryList',
@@ -101,7 +101,7 @@ public function __construct(TestFrameworkObjectManager $testFrameworkObjectManag
101101
$properties = get_object_vars($testFrameworkObjectManager);
102102
foreach ($properties as $key => $value) {
103103
if ($key === '_sharedInstances') {
104-
foreach($value as $class => $instance) {
104+
foreach ($value as $class => $instance) {
105105
if (in_array($class, $this->bootstrappedObjects)) {
106106
$this->_sharedInstances[$class] = $instance;
107107
}

0 commit comments

Comments
 (0)