2013-06-24 07:26:16 +08:00
|
|
|
<?php
|
|
|
|
$I = new TestGuy($scenario);
|
|
|
|
$I->wantTo('ensure that login works');
|
|
|
|
$I->amOnPage('?r=site/login');
|
|
|
|
$I->see('Login', 'h1');
|
|
|
|
|
2013-10-18 20:03:36 +08:00
|
|
|
$I->submitForm('#login-form', []);
|
2013-06-24 07:26:16 +08:00
|
|
|
$I->dontSee('Logout (admin)');
|
|
|
|
$I->see('Username cannot be blank');
|
|
|
|
$I->see('Password cannot be blank');
|
|
|
|
|
2013-10-18 20:03:36 +08:00
|
|
|
$I->submitForm('#login-form', [
|
2013-06-24 07:26:16 +08:00
|
|
|
'LoginForm[username]' => 'admin',
|
|
|
|
'LoginForm[password]' => 'wrong',
|
2013-10-18 20:03:36 +08:00
|
|
|
]);
|
2013-06-24 07:26:16 +08:00
|
|
|
$I->dontSee('Logout (admin)');
|
|
|
|
$I->see('Incorrect username or password');
|
|
|
|
|
2013-10-18 20:03:36 +08:00
|
|
|
$I->submitForm('#login-form', [
|
2013-06-24 07:26:16 +08:00
|
|
|
'LoginForm[username]' => 'admin',
|
|
|
|
'LoginForm[password]' => 'admin',
|
2013-10-18 20:03:36 +08:00
|
|
|
]);
|
2013-06-24 07:26:16 +08:00
|
|
|
$I->see('Logout (admin)');
|