当前位置: 首页>>代码示例>>PHP>>正文


PHP FunctionalTester::amOnRoute方法代码示例

本文整理汇总了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']);
 }
开发者ID:yii2mod,项目名称:base,代码行数:9,代码来源:CreateUserCest.php

示例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');
 }
开发者ID:codeception,项目名称:phalcon-demo,代码行数:7,代码来源:RoutesCest.php

示例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']);
 }
开发者ID:v-radev,项目名称:laravel-auth-pack,代码行数:8,代码来源:ResetFunctionalCest.php

示例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);
 }
开发者ID:furious-programming,项目名称:coyote,代码行数:8,代码来源:MicroblogsCest.php

示例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]);
 }
开发者ID:v-radev,项目名称:laravel-auth-pack,代码行数:9,代码来源:RegisterFunctionalCest.php

示例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('Справочники');*/
 }
开发者ID:vovancho,项目名称:yii2test,代码行数:23,代码来源:LoginCest.php

示例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]);
 }
开发者ID:lembarek,项目名称:auth,代码行数:14,代码来源:AuthControllerCest.php

示例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);
开发者ID:jvlstudio,项目名称:3N1WebSite,代码行数:18,代码来源:ArticleUpdateCept.php

示例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');
开发者ID:dan-powell,项目名称:shop,代码行数:10,代码来源:AddToCartCept.php

示例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);
开发者ID:adminrt,项目名称:phphub,代码行数:14,代码来源:UserIndexCept.php

示例11: _before

 public function _before(FunctionalTester $I)
 {
     $I->haveFixtures(['user' => ['class' => UserFixture::class]]);
     $I->amOnRoute('site/login');
 }
开发者ID:yii2mod,项目名称:base,代码行数:5,代码来源:ChangePasswordViaAccountPageCest.php

示例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.');
开发者ID:jianoll,项目名称:phphub,代码行数:22,代码来源:UserFavoritesCept.php

示例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.');
开发者ID:adminrt,项目名称:phphub,代码行数:25,代码来源:UserRepliesCept.php

示例14: visitARouteWithASubdomain

 public function visitARouteWithASubdomain(FunctionalTester $I)
 {
     $I->amOnRoute('subdomain', 'l4');
     $I->see('Subdomain route');
 }
开发者ID:resulaslan,项目名称:sample-l4-app,代码行数:5,代码来源:RoutesCest.php

示例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]);
开发者ID:adminrt,项目名称:phphub,代码行数:27,代码来源:NotificationReplyAtUserCept.php


注:本文中的FunctionalTester::amOnRoute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。