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


PHP FunctionalTester::haveRecord方法代码示例

本文整理汇总了PHP中FunctionalTester::haveRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::haveRecord方法的具体用法?PHP FunctionalTester::haveRecord怎么用?PHP FunctionalTester::haveRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FunctionalTester的用法示例。


在下文中一共展示了FunctionalTester::haveRecord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDuplicateEmail

 public function testDuplicateEmail(FunctionalTester $I)
 {
     $I->haveRecord('users', ['email' => $this->tester['email']]);
     $I->fillField('email', $this->tester['email']);
     $I->click('Register', 'button');
     $I->seeFormErrorMessage('email', 'already been taken');
 }
开发者ID:stellargames,项目名称:StellarDestiny,代码行数:7,代码来源:RegistrationCest.php

示例2: 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

示例3: deleteMyRedirect

 public function deleteMyRedirect(FunctionalTester $I)
 {
     $I->haveRecord('links', $this->linkRecord);
     LinksPage::of($I)->deleteLink();
     $I->dontSeeRecord('links', $this->linkRecord);
     $I->seeCurrentUrlEquals(LinksPage::$URL);
     $I->dontSee('/' . $this->link['uri']);
 }
开发者ID:mlanin,项目名称:go,代码行数:8,代码来源:LinksCest.php

示例4: deletePost

 public function deletePost(FunctionalTester $I)
 {
     $id = $I->haveRecord('posts', $this->postAttributes);
     $I->amOnPage(PostsPage::$url);
     $I->see('Hello Universe');
     PostsPage::of($I)->deletePost($id);
     $I->seeCurrentUrlEquals(PostsPage::$url);
     $I->dontSee('Hello Universe');
 }
开发者ID:jenky,项目名称:laravel-api-starter,代码行数:9,代码来源:PostCrudCest.php

示例5: testLoginSuccsess

 public function testLoginSuccsess(FunctionalTester $I)
 {
     $I->wantTo('login as a user');
     $I->haveRecord('users', ['name' => 'john', 'email' => 'john@gmail.com', 'password' => bcrypt('123456'), 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->amOnPage('auth/login');
     $I->fillField('email', 'john@gmail.com');
     $I->fillField('password', '123456');
     $I->click('Login');
     $I->amOnPage('/');
     $I->seeAuthentication();
 }
开发者ID:nguyentantintb,项目名称:wedding-card,代码行数:11,代码来源:WeddingCardTestCest.php

示例6: loginUsingCredentials

 public function loginUsingCredentials(FunctionalTester $I)
 {
     $I->dontSeeAuthentication();
     $I->haveRecord('users', $this->userAttributes);
     $I->amLoggedAs(['email' => 'john@doe.com', 'password' => 'password']);
     $I->amOnPage(PostsPage::$url);
     $I->seeCurrentUrlEquals(PostsPage::$url);
     $I->seeAuthentication();
     $I->logout();
     $I->dontSeeAuthentication();
 }
开发者ID:resulaslan,项目名称:sample-l4-app,代码行数:11,代码来源:AuthCest.php

示例7: tryRegisterDesiredInputWithDefaultRole

 public function tryRegisterDesiredInputWithDefaultRole(FunctionalTester $I)
 {
     $I->haveRecord('roles', ['id' => 2, 'name' => 'Spectator', 'slug' => 'spectator', 'landing' => 'admin/profile', 'is_default' => true, 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->wantTo('Register a user with desired input');
     $I->amOnPage('/register');
     $I->fillField('username', 'usertest');
     $I->fillField('email', 'usertest@email.com');
     $I->fillField('password', '123456');
     $I->fillField('password_confirmation', '123456');
     $I->click('button[type=submit]');
     $I->seeRecord('users', ['username' => 'usertest']);
     $I->seeCurrentUrlEquals('/login');
 }
开发者ID:inoplate,项目名称:account,代码行数:13,代码来源:RegisterCest.php

示例8: _before

 public function _before(FunctionalTester $I)
 {
     $dt = new DateTime();
     $I->haveRecord('roles', ['id' => 1, 'name' => 'Administrator', 'slug' => 'administrator', 'landing' => 'admin/dashboard', 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->haveRecord('users', ['id' => 1, 'username' => 'admin', 'email' => 'admin@site.com', 'password' => bcrypt('123456'), 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->haveRecord('users', ['id' => 2, 'username' => 'admin2', 'email' => 'admin2@site.com', 'password' => bcrypt('123456'), 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->haveRecord('password_resets', ['email' => 'admin@site.com', 'token' => 'reset-token', 'created_at' => new DateTime()]);
     $I->haveRecord('password_resets', ['email' => 'admin2@site.com', 'token' => 'reset-token2', 'created_at' => $dt->modify('-2 hour')]);
     $I->haveRecord('role_user', ['user_id' => 1, 'role_id' => 1]);
     $I->haveRecord('role_user', ['user_id' => 2, 'role_id' => 1]);
 }
开发者ID:inoplate,项目名称:account,代码行数:11,代码来源:PasswordCest.php

示例9: _before

 public function _before(FunctionalTester $I)
 {
     $I->haveRecord('roles', ['id' => 1, 'name' => 'Administrator', 'slug' => 'administrator', 'landing' => 'admin/dashboard', 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->haveRecord('roles', ['id' => 2, 'name' => 'Spectator', 'slug' => 'spectator', 'landing' => 'admin/profile', 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->haveRecord('users', ['id' => 1, 'username' => 'admin', 'email' => 'admin@site.com', 'password' => bcrypt('123456'), 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->haveRecord('users', ['id' => 2, 'username' => 'spectator', 'email' => 'spectator@site.com', 'password' => bcrypt('123456'), 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     $I->haveRecord('role_user', ['user_id' => 1, 'role_id' => 1]);
     $I->haveRecord('role_user', ['user_id' => 2, 'role_id' => 2]);
 }
开发者ID:inoplate,项目名称:account,代码行数:9,代码来源:LoginCest.php

示例10:

$I->see('Username', 'label');
$I->see('Password', 'label');
$I->see('Remember me', 'label');
$I->seeElement('input', ['value' => 'Log in', 'class' => 'btn btn-primary btn-block']);
$I->amGoingTo('fill an invalid user in order to see the errors');
// When
$I->fillField('username', 'admin');
$I->fillField('password', '12345');
// And
$I->click('Log in', 'input[type=submit]');
// Then
$I->expectTo('see an error message');
$I->seeCurrentUrlEquals('/login');
$I->seeInField('username', 'admin');
$I->see('Invalid data', '.alert-danger');
$I->haveRecord('users', ['first_name' => 'System', 'last_name' => 'Administrator', 'username' => 'admin', 'password' => Hash::make('secret'), 'email' => 'dacosta.dev@nucleogps.com', 'remember_token' => null]);
$I->amGoingTo('full a valid user and see the result');
// When
$I->fillField('password', 'secret');
// And
$I->click('Log in', 'input[type=submit]');
// Then
$I->seeCurrentUrlEquals('');
$I->see('You have arrived.', 'h1');
$I->see('Log out', 'a');
$I->seeAuthentication();
$I->amGoingTo('log out');
// When
$I->click('Log out', 'a');
// Then
$I->seeCurrentUrlEquals('/login');
开发者ID:hramose,项目名称:Nufarm-Encuesta,代码行数:31,代码来源:AuthenticateUserCept.php

示例11: FunctionalTester

<?php

use Coyote\Actkey;
$I = new FunctionalTester($scenario);
$I->wantTo('confirm my email address');
$userId = 100001;
$actkey = 'randomstring';
$I->haveRecord('users', ['id' => $userId, 'name' => 'Joe Doe', 'email' => 'joe@doe.com', 'password' => bcrypt('123'), 'created_at' => new DateTime(), 'updated_at' => new DateTime(), 'is_confirm' => 0]);
// uzywamy modelu poniewaz w tabeli nie ma klucza "id"
Actkey::create(['actkey' => $actkey, 'user_id' => $userId]);
$I->amOnPage("/User/Confirm/Email?id={$userId}&actkey={$actkey}");
$I->see('Adres e-mail został pozytywnie potwierdzony');
$I->dontSeeRecord('actkeys', ['actkey' => $actkey, 'user_id' => $userId]);
开发者ID:furious-programming,项目名称:coyote,代码行数:13,代码来源:ConfirmCept.php

示例12: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->am('a Administrator see Partners');
$I->dontSeeAuthentication();
$I->amLoggedAs(['email' => 'admin@admin.com', 'password' => 'admin']);
$I->seeAuthentication();
$id = $I->haveRecord('partners', ['name' => 'Mario', 'country_id' => 1, 'state_id' => 1, 'city_id' => 1]);
$I->amOnPage('/partners/' . $id);
$I->see('Mario');
开发者ID:raulbravo23,项目名称:salepoint,代码行数:10,代码来源:ShowPartnersCept.php

示例13: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->wantTo('I am Admin and Update Company Mau');
$I->dontSeeAuthentication();
$I->amLoggedAs(['email' => 'admin@admin.com', 'password' => 'admin']);
$I->seeAuthentication();
//When
$id = $I->haveRecord('companys', ['name' => 'Maur', 'partner_id' => '2', 'currency_id' => '3', 'fiscalRegimen_id' => '2']);
//And
$I->amOnPage('/settings/company/' . $id);
//then
$I->see('Edit');
//When
$I->click('Edit');
$I->seeCurrentUrlEquals('/settings/company/' . $id . '/edit');
$I->seeInField('name', 'Maur');
$I->seeInField('partner_id', '2');
$I->seeInField('currency_id', '3');
$I->seeInField('fiscalRegimen_id', '2');
//And
$I->amGoingTo('Change name of Maur to Association_Mau');
$form = ['name' => 'Association_Mau', 'partner_id' => '3', 'currency_id' => '2', 'fiscalRegimen_id' => '1'];
开发者ID:raulbravo23,项目名称:salepoint,代码行数:23,代码来源:EditCompanyCept.php

示例14: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->expectTo('have a usere in the database');
$I->haveRecord('users', ['username' => 'verem', 'password' => 'danverem', 'email' => 'danverem@gmail.com', 'profile_state' => 0]);
$I->expectTo('have a logged in user');
$user = $I->grabRecord('users', ['username' => 'verem']);
$I->amLoggedAs(['username' => $user->username, 'id' => $user->id, 'password' => $user->password]);
$I->wantTo('test if chops is posting to database');
$I->amOnAction('ChopsController@create');
$I->seeInCurrentUrl('/create');
$I->see('What\'s that special meal you just ate today');
$I->fillField('name', 'edikaikong');
$I->attachFile('image', 'julia.jpeg');
$I->fillField('about', 'This food is the best dish in the country');
$I->click('submitButton');
$I->seeInCurrentUrl('/chops');
开发者ID:andela,项目名称:chopbox,代码行数:17,代码来源:CreateChopsCept.php

示例15: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->wantTo('login as a user');
$I->haveRecord('users', ['name' => 'Joe Doe', 'email' => 'joe@doe.com', 'password' => bcrypt('123'), 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
$I->amOnPage('/Login');
$I->fillField('name', 'Joe Doe');
$I->fillField('password', '123');
$I->click('button[type=submit]');
$I->amOnPage('/');
$I->seeAuthentication();
$I->see('Joe Doe', '.dropdown-username');
开发者ID:furious-programming,项目名称:coyote,代码行数:12,代码来源:LoginCept.php


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