Skip to content

Commit 517dc29

Browse files
author
Krishna Kumar
committed
Added PHPMD suppress comment in testing
1 parent 1e10126 commit 517dc29

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

app/code/Magento/LoginAsCustomerGraphQl/Model/Resolver/RequestCustomerToken.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
use Magento\Framework\Exception\LocalizedException;
1212
use Magento\Framework\Exception\NoSuchEntityException;
1313
use Magento\Framework\GraphQl\Config\Element\Field;
14-
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
15-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
16-
use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException;
17-
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1814
use Magento\Framework\GraphQl\Query\Resolver\Value;
1915
use Magento\Framework\GraphQl\Query\ResolverInterface;
2016
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
17+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
18+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
19+
use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException;
20+
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
2121
use Magento\LoginAsCustomerApi\Api\ConfigInterface as LoginAsCustomerConfig;
2222
use Magento\LoginAsCustomerGraphQl\Model\LoginAsCustomer\CreateCustomerToken;
2323

app/code/Magento/LoginAsCustomerGraphQl/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
"Magento\\LoginAsCustomerGraphQl\\": ""
2525
}
2626
},
27-
"version": "1.0.0"
27+
"version": "1.0.1"
2828
}

dev/tests/api-functional/testsuite/Magento/GraphQl/LoginAsCustomer/GenerateLoginCustomerTokenTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
/**
1818
* API-functional tests cases for generateCustomerToken mutation
19+
* @SuppressWarnings(PHPMD)
1920
*/
2021
class GenerateLoginCustomerTokenTest extends GraphQlAbstract
2122
{
@@ -71,12 +72,12 @@ public function testGenerateCustomerValidTokenLoginAsCustomerEnabled()
7172
*/
7273
public function testGenerateCustomerValidTokenLoginAsCustomerDisabled()
7374
{
74-
$customerEmail = '[email protected]';
75-
76-
$mutation = $this->getQuery($customerEmail);
7775
$this->expectException(Exception::class);
7876
$this->expectExceptionMessage("Login as Customer is disabled..");
7977

78+
$customerEmail = '[email protected]';
79+
80+
$mutation = $this->getQuery($customerEmail);
8081
$response = $this->graphQlMutation(
8182
$mutation,
8283
[],
@@ -96,14 +97,14 @@ public function testGenerateCustomerValidTokenLoginAsCustomerDisabled()
9697
*/
9798
public function testGenerateCustomerTokenLoginWithCustomerCredentials()
9899
{
100+
$this->expectException(Exception::class);
101+
$this->expectExceptionMessage("The current customer isn't authorized.");
102+
99103
$customerEmail = '[email protected]';
100104
$password = 'password';
101105

102106
$mutation = $this->getQuery($customerEmail);
103107

104-
$this->expectException(Exception::class);
105-
$this->expectExceptionMessage("The current customer isn't authorized.");
106-
107108
$response = $this->graphQlMutation(
108109
$mutation,
109110
[],
@@ -133,9 +134,9 @@ public function testGenerateCustomerTokenInvalidData(
133134
string $message
134135
) {
135136
$this->expectException(Exception::class);
137+
$this->expectExceptionMessage($message);
136138

137139
$mutation = $this->getQuery($customerEmail);
138-
$this->expectExceptionMessage($message);
139140
$response = $this->graphQlMutation(
140141
$mutation,
141142
[],

dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_disable.php

100644100755
File mode changed.

dev/tests/integration/testsuite/Magento/LoginAsCustomer/_files/login_as_customer_config_enable_rollback.php

100644100755
File mode changed.

0 commit comments

Comments
 (0)