1 | <?php |
||
8 | use SlayerBirden\DataFlowServer\Domain\Entities\User; |
||
9 | |||
10 | class GenerateTmpTokenCest |
||
11 | { |
||
12 | /** |
||
13 | * @var int |
||
14 | */ |
||
15 | private $userId; |
||
16 | |||
17 | public function _before(ApiTester $I) |
||
38 | |||
39 | /** |
||
40 | * @param ApiTester $I |
||
41 | * @throws Exception |
||
42 | */ |
||
43 | public function createTmpTokenSuccess(ApiTester $I) |
||
65 | |||
66 | /** |
||
67 | * @param ApiTester $I |
||
68 | * @throws Exception |
||
69 | */ |
||
70 | public function createTmpTokenForNonExistingUser(ApiTester $I) |
||
84 | |||
85 | /** |
||
86 | * @param ApiTester $I |
||
87 | * @throws Exception |
||
88 | */ |
||
89 | public function createTmpTokenNotPermitted(ApiTester $I) |
||
103 | |||
104 | /** |
||
105 | * @param ApiTester $I |
||
106 | * @throws Exception |
||
107 | */ |
||
108 | public function createTmpTokenValidationError(ApiTester $I) |
||
127 | |||
128 | /** |
||
129 | * @param ApiTester $I |
||
130 | * @throws Exception |
||
131 | */ |
||
132 | public function createTmpTokenValidationErrorNonExistingResource(ApiTester $I) |
||
133 | { |
||
134 | $I->wantTo('create tmp token for non existing resource'); |
||
135 | $I->haveHttpHeader('Content-Type', 'application/json'); |
||
136 | $I->sendPOST('/gettmptoken/' . (string)$this->userId, [ |
||
137 | 'resources' => [ |
||
138 | 'bar' |
||
139 | ], |
||
140 | ]); |
||
141 | $I->seeResponseCodeIs(HttpCode::BAD_REQUEST); |
||
142 | $I->seeResponseContainsJson([ |
||
143 | 'success' => false, |
||
144 | ]); |
||
145 | } |
||
147 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.