Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class AuthCest
// tests
public function validCredentials(ApiTester $I)
$I->wantTo('Generate access token');
$email = uniqid('email-') . '';
$password = uniqid('password-');
// create user in database
$userId = $I->createUser([
'email' => $email,
'password' => $password
// generate access token via API
$I->haveHttpHeader('Content-Type', 'application/json');
$I->sendPOST('/api/v1/auth/authenticate', ['email' => $email, 'password' => $password]);
// validate response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment