| Total Complexity | 2 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class SiteCest |
||
| 11 | { |
||
| 12 | public function getHome(AcceptanceTester $I): void |
||
| 13 | { |
||
| 14 | $I->sendGET('/'); |
||
| 15 | $I->seeResponseCodeIs(HttpCode::OK); |
||
| 16 | $I->seeResponseIsJson(); |
||
| 17 | $I->seeResponseContainsJson( |
||
| 18 | [ |
||
| 19 | 'status' => 'success', |
||
| 20 | 'error_message' => '', |
||
| 21 | 'error_code' => null, |
||
| 22 | 'data' => [ |
||
| 23 | 'version' => '3.0', |
||
| 24 | 'author' => 'yiisoft', |
||
| 25 | ], |
||
| 26 | ] |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function testNotFoundPage(AcceptanceTester $I): void |
||
| 31 | { |
||
| 32 | $I->sendGET('/not_found_page'); |
||
| 33 | $I->seeResponseCodeIs(HttpCode::NOT_FOUND); |
||
| 34 | $I->seeResponseIsJson(); |
||
| 35 | $I->seeResponseContainsJson( |
||
| 36 | [ |
||
| 37 | 'status' => 'failed', |
||
| 38 | 'error_message' => 'Page not found', |
||
| 39 | 'error_code' => 404, |
||
| 40 | 'data' => null, |
||
| 41 | ] |
||
| 45 |