本文整理汇总了PHP中FunctionalTester::amOnRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::amOnRoute方法的具体用法?PHP FunctionalTester::amOnRoute怎么用?PHP FunctionalTester::amOnRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::amOnRoute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createUser
public function createUser(FunctionalTester $I)
{
$I->amOnRoute('site/login');
$I->submitForm($this->loginFormId, $this->loginFormParams('admin@example.org', '123123'));
$I->amOnRoute('/admin/user/create');
$I->see('Create User');
$I->submitForm($this->createUserFormId, $this->createUserFormParams('created-user', 'created-user@example.com', '123123'));
$I->seeRecord('app\\models\\UserModel', ['username' => 'created-user', 'email' => 'created-user@example.com']);
}
示例2: openPageByRoute
public function openPageByRoute(FunctionalTester $I)
{
$I->amOnRoute('front.contact');
$I->see('Contact Us');
$I->see('Send us a message and let us know how we can help.');
$I->seeCurrentUrlEquals('/contact-us');
}
示例3: it_successfully_sends_password_reset_mail_link
public function it_successfully_sends_password_reset_mail_link(FunctionalTester $I)
{
$I->amOnRoute(PasswordResetPage::$ROUTE);
$I->fillField('email', 'email@example.com');
$I->submitForm(PasswordResetPage::$formId, [], PasswordResetPage::$submit);
$I->see('Reset link was successfully sent. Please check your email.');
$I->seeRecord('password_resets', ['email' => 'email@example.com']);
}
示例4: canEditMicroblog
public function canEditMicroblog(FunctionalTester $I)
{
$fake = Factory::create();
$text = $fake->text();
$id = $I->haveRecord('microblogs', ['user_id' => $this->user->id, 'text' => $text, 'created_at' => new DateTime(), 'updated_at' => new DateTime(), 'score' => 0]);
$I->amOnRoute('microblog.save', [$id]);
$I->see($text);
}
示例5: it_has_permission_in_db_after_registration
public function it_has_permission_in_db_after_registration(FunctionalTester $I)
{
$I->amOnRoute(RegisterPage::$ROUTE);
$userData = $this->userActor->fillRegisterPageFields($I);
$I->submitForm(RegisterPage::$formId, [], 'Register');
$user = $I->grabRecord('users', ['username' => $userData['username']]);
$permission = Permission::where('name', '=', array_shift(Permission::$defaultPermissions))->first();
$I->seeRecord(UserPermission::$tableName, ['user_id' => $user->id, 'permission_id' => $permission->id]);
}
示例6: openFregat
/**
* @depends loginSuccessfully
*/
public function openFregat(\FunctionalTester $I)
{
$I->setCookie('_identity', $this->cookie_identity);
$I->setCookie('PHPSESSID', $this->cookie_session);
// $I->click('Fregat/fregat/mainmenu');
$I->amOnRoute('site/index');
$I->see('Система "Фрегат"');
$I->amOnRoute('Fregat/fregat/mainmenu');
$I->see('Справочники');
/* $I->click('//div[contains(text(), "Фрегат")]');
$I->see('Журнал материальных ценностей');
$I->see('Журнал перемещений материальных ценностей');
$I->see('Журнал снятия комплектующих с материальных ценностей');
$I->see('Журнал осмотров материальных ценностей');
$I->see('Журнал осмотров материалов');
$I->see('Журнал восстановления материальных ценностей');
$I->see('Журнал списания основных средств');
$I->see('Импорт данных');
$I->see('Справочники');*/
}
示例7: it_register_a_valide_user
public function it_register_a_valide_user(FunctionalTester $I)
{
$name = 'joe';
$email = 'joe@gmail.com';
$password = 'secret';
$I->amOnRoute('user:register');
$I->fillField('username', $name);
$I->fillField('email', $email);
$I->fillField('password', $password);
$I->fillField('password_confirmation', $password);
$I->click(Lang::get('form.register'));
//$I->seePageIs(route('home'));
//$I->seeInDatabase('users', ['username' => $name, 'email' => $email]);
}
示例8: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('Update Article Tests');
// Not signed tests
$I->amOnRoute('article.edit', 19);
$I->seeCurrentUrlEquals('/auth/login');
// Sign in
$I->signIn();
// Update Article
$I->amOnRoute('article.edit', 19);
$I->see('Edit Article');
$I->fillField('form input[name=title]', 'New Article by FunctionalTester');
$I->selectOption('form select[name=category_id]', '1');
$I->fillField('form textarea[name=body]', 'bodybodybody \\n by FunctionalTester');
$I->click('form [type=submit]');
$I->seeCurrentUrlMatches('~^/article/(\\d+)$~');
$I->seeCurrentRouteIs('article.show', 19);
示例9: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('Add a product to cart');
$product = $I->createModel(DanPowell\Shop\Models\Product::class, [], 'published', 1);
$I->amOnRoute('shop.product.show', $product->slug);
$I->click('Add to Cart');
$I->seeCurrentRouteIs('shop.cart.show');
$I->see('Product added to cart', '.alert');
$I->see($product->title, '.CartTable-product-title');
示例10: FunctionalTester
<?php
/**
* ------------------------------------
* Testing User index
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
$I->am('a Phphub member');
$I->wantTo('List all the user are registered for PHPHUB');
$user = $I->have('User', ['name' => 'SuperMeOriganal', 'created_at' => Carbon::now()->toDateTimeString()]);
$I->seeRecord('users', ['id' => $user->id]);
$I->amOnRoute('users.index');
$I->seeElement('.users-index-' . $user->id);
示例11: _before
public function _before(FunctionalTester $I)
{
$I->haveFixtures(['user' => ['class' => UserFixture::class]]);
$I->amOnRoute('site/login');
}
示例12: FunctionalTester
<?php
/**
* ------------------------------------
* User favorites
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Visit a users.favorites as a Visitor and as a Member.');
$user = $I->have('User');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
$favorite = $I->have('Favorite', ['user_id' => $user->id, 'topic_id' => $topic->id]);
// --------------- As a visitor --------------
$I->am('as a Visitor');
$I->amOnRoute('users.favorites', $user->id);
$I->see('My Awsome Topic.');
// --------------- As a member --------------
$I->am('as a Member');
$I->signIn();
$I->amOnRoute('users.favorites', $user->id);
$I->see('My Awsome Topic.');
示例13: FunctionalTester
<?php
/**
* ------------------------------------
* User replies
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Visit a users.replies as a Visitor and as a Member.');
$user = $I->have('User');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
$data = ['body' => 'My Awsome Reply.', 'topic_id' => $topic->id, 'user_id' => $user->id];
$reply = $I->have('Reply', $data);
// --------------- As a visitor --------------
$I->am('as a Visitor');
$I->amOnRoute('users.replies', $user->id);
$I->see('My Awsome Topic.');
$I->see('My Awsome Reply.');
// --------------- As a member --------------
$I->am('as a Member');
$I->signIn();
$I->amOnRoute('users.replies', $user->id);
$I->see('My Awsome Topic.');
$I->see('My Awsome Reply.');
示例14: visitARouteWithASubdomain
public function visitARouteWithASubdomain(FunctionalTester $I)
{
$I->amOnRoute('subdomain', 'l4');
$I->see('Subdomain route');
}
示例15: FunctionalTester
<?php
/**
* ------------------------------------
* Notify user being "@"
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Notify a User when he/she is being AT on a newly Reply');
$SuperMan = $I->have('User', ['name' => 'SuperMan']);
$user = $I->signIn();
$topic = $I->postATopic(['title' => 'My Awsome Topic.', 'user_id' => $user->id]);
// another user leave a reply
$randomUser = $I->signIn();
$I->amOnRoute('topics.show', $topic->id);
$I->fillField(['name' => 'body'], 'The Awsome Reply. @SuperMan');
$I->click('#reply-create-submit');
$I->see('The Awsome Reply. <a href="' . route('users.show', $SuperMan->id) . '">@SuperMan</a>');
// sign in the author
$user = $I->signIn($SuperMan);
$I->seeRecord('users', ['id' => $user->id, 'notification_count' => 1]);
$I->amOnRoute('notifications.index');
$I->see('My Awsome Topic.');
$I->see('The Awsome Reply. <a href="' . route('users.show', $SuperMan->id) . '">@SuperMan</a>');
$I->see($randomUser->name);
$I->seeRecord('users', ['id' => $user->id, 'notification_count' => 0]);