1 | <?php |
||
6 | use SlayerBirden\DataFlowServer\Doctrine\Hydrator\Strategy\ObscuredStrategy; |
||
7 | |||
8 | class AddConfigCest |
||
9 | { |
||
10 | public function addConfiguration(ApiTester $I) |
||
29 | |||
30 | public function addIncompleteConfig(ApiTester $I) |
||
50 | |||
51 | public function addCompleteNonUrlConfig(ApiTester $I) |
||
52 | { |
||
53 | $I->wantTo('create incomplete db configuration'); |
||
54 | $I->haveHttpHeader('Content-Type', 'application/json'); |
||
55 | $I->sendPOST('/config', [ |
||
56 | 'title' => 'Test config', |
||
57 | 'dbname' => 'test', |
||
58 | 'user' => 'test-user', |
||
59 | 'password' => 'test-pwd', |
||
60 | 'port' => '3306', |
||
61 | 'host' => 'localhost', |
||
62 | 'driver' => 'pdo_mysql' |
||
63 | ]); |
||
64 | $I->seeResponseCodeIs(HttpCode::OK); |
||
65 | $I->seeResponseContainsJson([ |
||
66 | 'success' => true, |
||
67 | 'data' => [ |
||
68 | 'configuration' => [ |
||
69 | 'title' => 'Test config', |
||
70 | 'dbname' => 'test', |
||
71 | 'user' => 'test-user', |
||
72 | 'password' => ObscuredStrategy::OBSCURED_STRING, |
||
73 | 'port' => '3306', |
||
74 | 'host' => 'localhost', |
||
75 | 'driver' => 'pdo_mysql' |
||
76 | ] |
||
77 | ] |
||
78 | ]); |
||
79 | } |
||
81 |
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.