ROAResearch /
yii2-roa
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | namespace roaresearch\yii2\roa\test; |
||||||
| 4 | |||||||
| 5 | use Codeception\{Example, Util\HttpCode}; |
||||||
| 6 | |||||||
| 7 | abstract class AbstractAccessTokenCest |
||||||
| 8 | { |
||||||
| 9 | /** |
||||||
| 10 | * Generates and stores an auth token. |
||||||
| 11 | * |
||||||
| 12 | * @param Tester $I |
||||||
| 13 | * @param Example $example must contain keys: |
||||||
| 14 | * - client: string http client. |
||||||
| 15 | * - clientPass: string http password. |
||||||
| 16 | * - user: string system user. |
||||||
| 17 | * - userPass: string user password. |
||||||
| 18 | * - tokenName: token name used to store the auth token. |
||||||
| 19 | */ |
||||||
| 20 | protected function generateToken(Tester $I, Example $example) |
||||||
| 21 | { |
||||||
| 22 | $I->amHttpAuthenticated($example['client'], $example['clientPass']); |
||||||
|
0 ignored issues
–
show
|
|||||||
| 23 | $I->sendPOST($this->getRoute(), [ |
||||||
|
0 ignored issues
–
show
The method
sendPOST() does not exist on roaresearch\yii2\roa\test\Tester.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||||
| 24 | 'grant_type' => 'password', |
||||||
| 25 | 'username' => $example['user'], |
||||||
| 26 | 'password' => $example['userPass'], |
||||||
| 27 | ]); |
||||||
| 28 | $I->seeResponseCodeIs(HttpCode::OK); |
||||||
|
0 ignored issues
–
show
The method
seeResponseCodeIs() does not exist on roaresearch\yii2\roa\test\Tester.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||||
| 29 | $I->seeResponseIsJson(); |
||||||
|
0 ignored issues
–
show
The method
seeResponseIsJson() does not exist on roaresearch\yii2\roa\test\Tester.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||||
| 30 | $I->seeResponseMatchesJsonType([ |
||||||
|
0 ignored issues
–
show
The method
seeResponseMatchesJsonType() does not exist on roaresearch\yii2\roa\test\Tester.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||||
| 31 | 'access_token' => 'string:regex(/[0-9a-f]{40}/)', |
||||||
| 32 | 'refresh_token' => 'string:regex(/[0-9a-f]{40}/)', |
||||||
| 33 | ]); |
||||||
| 34 | $I->storeToken( |
||||||
| 35 | $example['tokenName'], |
||||||
| 36 | $I->grabDataFromResponseByJsonPath('access_token')[0] |
||||||
|
0 ignored issues
–
show
The method
grabDataFromResponseByJsonPath() does not exist on roaresearch\yii2\roa\test\Tester.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||||
| 37 | ); |
||||||
| 38 | } |
||||||
| 39 | |||||||
| 40 | /** |
||||||
| 41 | * @return string url route which generates the token. |
||||||
| 42 | */ |
||||||
| 43 | protected function getRoute() |
||||||
| 44 | { |
||||||
| 45 | return 'oauth2/token'; |
||||||
| 46 | } |
||||||
| 47 | } |
||||||
| 48 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.