|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of the Spryker Commerce OS. |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
declare(strict_types = 1); |
|
9
|
|
|
|
|
10
|
|
|
namespace PyzTest\Glue\AgentAuth; |
|
11
|
|
|
|
|
12
|
|
|
use SprykerTest\Glue\Testify\Tester\ApiEndToEndTester; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* Inherited Methods |
|
16
|
|
|
* |
|
17
|
|
|
* @method void wantToTest($text) |
|
18
|
|
|
* @method void wantTo($text) |
|
19
|
|
|
* @method void execute($callable) |
|
20
|
|
|
* @method void expectTo($prediction) |
|
21
|
|
|
* @method void expect($prediction) |
|
22
|
|
|
* @method void amGoingTo($argumentation) |
|
23
|
|
|
* @method void am($role) |
|
24
|
|
|
* @method void lookForwardTo($achieveValue) |
|
25
|
|
|
* @method void comment($description) |
|
26
|
|
|
* @method void pause() |
|
27
|
|
|
* |
|
28
|
|
|
* @SuppressWarnings(\PyzTest\Glue\AgentAuth\PHPMD) |
|
29
|
|
|
*/ |
|
30
|
|
|
class AgentAuthRestApiTester extends ApiEndToEndTester |
|
31
|
|
|
{ |
|
32
|
|
|
use _generated\AgentAuthRestApiTesterActions; |
|
|
|
|
|
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* @var string |
|
36
|
|
|
*/ |
|
37
|
|
|
protected const ACCESS_TOKEN_JSON_PATH = '$.data.attributes.accessToken'; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @var string |
|
41
|
|
|
*/ |
|
42
|
|
|
protected const REFRESH_TOKEN_JSON_PATH = '$.data.attributes.refreshToken'; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* @return void |
|
46
|
|
|
*/ |
|
47
|
|
|
public function seeResponseHasAccessToken(): void |
|
48
|
|
|
{ |
|
49
|
|
|
$this->assertNotEmpty($this->getDataFromResponseByJsonPath(static::ACCESS_TOKEN_JSON_PATH)); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @return void |
|
54
|
|
|
*/ |
|
55
|
|
|
public function seeResponseHasRefreshToken(): void |
|
56
|
|
|
{ |
|
57
|
|
|
$this->assertNotEmpty($this->getDataFromResponseByJsonPath(static::REFRESH_TOKEN_JSON_PATH)); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @return void |
|
62
|
|
|
*/ |
|
63
|
|
|
public function seeResponseDoesNotHaveAccessToken(): void |
|
64
|
|
|
{ |
|
65
|
|
|
$this->assertFalse($this->getDataFromResponseByJsonPath(static::ACCESS_TOKEN_JSON_PATH)); |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @return void |
|
70
|
|
|
*/ |
|
71
|
|
|
public function seeResponseDoesNotHaveRefreshToken(): void |
|
72
|
|
|
{ |
|
73
|
|
|
$this->assertFalse($this->getDataFromResponseByJsonPath(static::REFRESH_TOKEN_JSON_PATH)); |
|
74
|
|
|
} |
|
75
|
|
|
} |
|
76
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths