Beispiel #1
0
 public function checkLogin(APITester $I)
 {
     $I->amHttpAuthenticated('admin', 'testpassword');
     $I->sendGET('/login');
     $I->seeResponseCodeIs(201);
     $I->seeResponseIsJson();
     $I->seeResponseContainsJson(['status' => 'ok']);
 }
 function createAUserWithMissingEmail(APITester $I)
 {
     $I->wantTo('See an error message when missing an email');
     $I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded');
     $I->sendPOST('users', ['username' => 'username', 'password' => 'password', 'password_conf' => 'password']);
     $I->seeResponseCodeIs(400);
     $I->seeResponseIsJson();
     $I->seeResponseContainsJson(['status' => 'fail']);
 }
Beispiel #3
0
 public function getOnePage(APITester $I)
 {
     $I->sendGET('/pages/home');
     $I->seeResponseCodeIs(200);
     $I->seeResponseContainsJson(['slug' => 'home']);
 }