本文整理汇总了PHP中AcceptanceTester::amOnRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::amOnRoute方法的具体用法?PHP AcceptanceTester::amOnRoute怎么用?PHP AcceptanceTester::amOnRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcceptanceTester
的用法示例。
在下文中一共展示了AcceptanceTester::amOnRoute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: it_validates_required_fields
public function it_validates_required_fields(AcceptanceTester $I)
{
$I->amOnRoute(LoginPage::$ROUTE);
$I->submitForm(LoginPage::$formId, [], 'Login');
$I->see('The username field is required.');
$I->see('The password field is required.');
}
示例2: likes
public function likes(\AcceptanceTester $I)
{
$answer = App\Models\Answer::get()->random();
$user = App\Models\User::get()->random();
\Auth::login($user);
$likes = $answer->likes->count();
$I->wantTo('like answer');
$I->amOnRoute('q', ['id' => $answer->question->id]);
$I->see($answer->question->title);
$c = $likes ? (int) $I->grabTextFrom('li#answer_' . $answer->id . ' a.btn_like .like_count') : 0;
$I->assertEquals($likes, $c);
$I->click('li#answer_' . $answer->id . ' a.btn_like');
$I->amOnRoute('q', ['id' => $answer->question->id]);
$answer = App\Models\Answer::find($answer->id);
$I->assertEquals($likes + 1, $answer->likes->count());
}
示例3: it_prevents_guests_from_seeing_profiles
public function it_prevents_guests_from_seeing_profiles(AcceptanceTester $I)
{
$user = $this->userActor->create();
$I->amOnRoute('profile.show', $user->username);
$I->seeInCurrentUrl('auth/login');
$I->seeCurrentRouteIs('auth.login');
$I->dontSee('Profile of user');
}
示例4: it_registers_successfully
public function it_registers_successfully(AcceptanceTester $I)
{
$userActor = new \Actors\UserActor();
$I->amOnRoute(RegisterPage::$ROUTE);
$userActor->fillRegisterPageFields($I);
$I->submitForm(RegisterPage::$formId, [], 'Register');
$I->see('View profile');
$I->see('Edit profile');
$I->see('Logout');
}
示例5: it_validates_required_password_reset_form_email_field
public function it_validates_required_password_reset_form_email_field(AcceptanceTester $I)
{
$I->amOnRoute(PasswordResetPage::$ROUTE);
$I->submitForm(PasswordResetPage::$formId, [], PasswordResetPage::$submit);
$I->see('The email field is required.');
}