本文整理汇总了PHP中FunctionalTester::seeRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::seeRecord方法的具体用法?PHP FunctionalTester::seeRecord怎么用?PHP FunctionalTester::seeRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::seeRecord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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']);
}
示例2: 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']);
}
示例3: testValidRegistration
public function testValidRegistration(FunctionalTester $I)
{
$I->fillField('name', $this->tester['name']);
$I->fillField('email', $this->tester['email']);
$I->fillField('password', $this->tester['password']);
$I->fillField('password_confirmation', $this->tester['password']);
$I->click('Register', 'button');
$I->dontSeeFormErrors();
$I->seeRecord('users', ['name' => $this->tester['name'], 'email' => $this->tester['email']]);
$I->seeAuthentication();
}
示例4: addTag
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function addTag(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('add new tag');
$tag = new Tag();
$group = $tag->getGroups()->random(1);
$data = ['name' => 'tag1', 'group' => $group->id, 'bgcolor' => 'red'];
$I->amLoggedAs($I->createUser(1, 4));
$I->amOnAction('Administration\\TagsController@getNew');
$I->submitForm('form', $data);
$I->seeCurrentActionIs('Administration\\TagsController@getIndex');
$I->seeRecord($tag->getTable(), $data);
}
示例5: tryToResetPasswordWithValidToken
public function tryToResetPasswordWithValidToken(FunctionalTester $I)
{
$I->seeRecord('password_resets', ['email' => 'admin@site.com']);
$I->wantTo('Reset my password invalid token');
$I->amOnPage('/password/reset/reset-token');
$I->fillField('email', 'admin@site.com');
$I->fillField('password', '123456');
$I->fillField('password_confirmation', '123456');
$I->click('button[type=submit]');
$I->dontSeeRecord('password_resets', ['email' => 'admin@site.com']);
$I->seeAuthentication();
$I->seeCurrentUrlEquals('/admin/dashboard');
}
示例6: 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');
}
示例7: it_successfully_detaches_permission
public function it_successfully_detaches_permission(FunctionalTester $I)
{
$user = $this->userActor->create();
$permission = 'accessDashboard';
$permissionId = Permission::where('name', '=', $permission)->firstOrFail()->id;
$user->setRole('admin');
$I->assertTrue($user->attachPermission($permission));
$I->seeRecord($this->UPT, ['user_id' => $user->id, 'permission_id' => $permissionId]);
$user->detachPermission($permission);
$I->dontSeeRecord($this->UPT, ['user_id' => $user->id, 'permission_id' => $permissionId]);
}
示例8: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('manually shorten a url');
$I->amOnPage('/');
$I->fillField('.shortInput', 'http://www.example.com');
$I->click('Go');
$I->amOnPage('/');
$I->see('http://localhost', '.result');
$hash = $I->grabTextFrom('~http://localhost/([^\\<]+)~');
$I->seeRecord('urls', ['url' => 'http://www.example.com', 'hash' => $hash]);
示例9: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->am('a Administrator user');
$I->dontSeeAuthentication();
$I->amLoggedAs(['email' => 'admin@admin.com', 'password' => 'admin']);
$I->seeAuthentication();
//When
$I->amOnPage('/settings/users');
//And
$I->click('Create');
//Then
$I->seeCurrentUrlEquals('/settings/users/create');
//when
$form = ['name' => 'Mario', 'email' => 'mario@test.com'];
//And
$I->submitForm('//form', $form, 'Save');
//Then
$I->seeFormErrorMessage('password', 'The Password field is required.');
//When
$form = ['name' => 'Mario', 'email' => 'mario@test.com', 'password' => '123456', 'password_confirmation' => '123456'];
//and
$I->submitForm('//form', $form, 'Save');
//then
$I->seeCurrentUrlEquals('/settings/users');
$I->see('Mario');
$I->seeRecord('users', ['name' => 'Mario', 'email' => 'mario@test.com']);
示例10: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
//setup
$I->am('a guest');
$I->wantTo('register an account');
//action
$I->amOnPage('/register');
$I->see('Inscription');
$I->fillField(['name' => 'firstname'], 'John');
$I->fillField(['name' => 'lastname'], 'Doe');
$I->fillField(['name' => 'email'], 'john.doe@mail.com');
$I->fillField(['name' => 'password'], 'password');
$I->fillField(['name' => 'password_confirmation'], 'password');
$I->click('submit-register');
//verify
$I->canSeeAuthentication();
$I->seeRecord('users', array('email' => 'john.doe@mail.com'));
示例11:
$I->seeCurrentUrlEquals('/admin/sections/' . $id . '/edit');
$I->see('Edit section "Our company"', 'h1');
$I->seeInField('name', 'Our company');
$I->seeInField('slug_url', 'our-company');
$I->seeInField('menu_order', 2);
$I->seeOptionIsSelected('published', 0);
$I->seeOptionIsSelected('menu', 1);
$I->seeOptionIsSelected('type', 'Page');
$I->amGoingTo('Submit an invalid form');
// When
$I->fillField('name', '');
// And
$I->click('Update section');
// Then
$I->expectTo('see the form back with data and errors');
$I->seeCurrentUrlEquals('/admin/sections/' . $id . '/edit');
$I->seeInField('name', '');
$I->seeInField('slug_url', 'our-company');
$I->see('The name field is required', '.error');
$I->amGoingTo('Submit a valid form');
// When
$I->fillField('name', 'Who we are');
$I->selectOption('published', 1);
// And
$I->click('Update section');
// Then
$I->expectTo('see the section details with the new changes');
$I->seeCurrentUrlEquals('/admin/sections/' . $id);
$I->see('Who we are', 'h1');
$I->seeRecord('sections', ['id' => $id, 'name' => 'Who we are', 'published' => 1, 'slug_url' => 'our-company', 'type' => 'page', 'menu_order' => 2, 'menu' => 1]);
示例12: FunctionalTester
<?php
/**
* ------------------------------------
* Testing User Show
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
$I->am('as a visitor');
$I->wantTo('See a user profile.');
$user = $I->have('User', ['name' => 'SuperMeOriganal2', 'created_at' => Carbon::now()->toDateTimeString()]);
$I->seeRecord('users', ['id' => $user->id]);
$I->amOnRoute('users.show', $user->id);
$I->see('SuperMeOriganal2');
示例13: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('Sign up for a larabook account');
$I->amOnPage('/');
$I->click('Sign Up!');
$I->seeCurrentUrlEquals('/register');
$I->fillField('username', 'JohnDoe');
$I->fillField('email', 'John@example.com');
$I->fillField('password', 'demo');
$I->fillField('password_confirmation', 'demo');
$I->click('Sign Up');
$I->seeCurrentUrlEquals('');
$I->see('Welcome to Larabook!');
$I->seeRecord('users', [
'username' => 'JohnDoe',
'email' => 'john@example.com'
]);
示例14: get_forgotten_password_email_with_recorded_email
public function get_forgotten_password_email_with_recorded_email(FunctionalTester $I)
{
$I->am('Unlogged user');
$I->wantTo('receive my password reset email by using the forgotten password feature');
$I->expectTo('see a success confirmation message explaining that the e-mail has been sent');
/***************************************************************************************************************
* settings
**************************************************************************************************************/
$I->resetEmails();
/***************************************************************************************************************
* run test
**************************************************************************************************************/
$I->amOnPage('/');
$I->seeCurrentRouteIs('home');
$I->click(trans('template.front.header.my_account'));
$I->seeCurrentRouteIs('login.index');
$I->fillField('email', $this->_user->email);
$I->fillField('password', 'truc');
$I->click(trans('auth.login.action.login'));
$I->seeCurrentRouteIs('login.index');
$I->see(trans('global.modal.alert.title.error'));
$I->click(trans('auth.login.label.forgotten_password'));
$I->seeCurrentRouteIs('password.index');
$I->seeInField('email', $this->_user->email);
$I->click(trans('auth.password.forgotten.action.send'));
$I->see(trans('global.modal.alert.title.success'), 'h3');
$I->see(strip_tags(trans('auth.message.password_reset.email.success', ['email' => 'test@test.fr'])));
$I->seeCurrentRouteIs('login.index');
$I->seeRecord('reminders', ['user_id' => $this->_user->id, 'completed' => false]);
$I->seeInLastEmailTo($this->_user->email, htmlentities(trans('emails.password_reset.title')), 'h3');
$I->seeInLastEmailTo($this->_user->email, htmlentities(trans('emails.password_reset.hello', ['name' => $this->_user->first_name . ' ' . $this->_user->last_name])), 'p');
$I->seeInLastEmailTo($this->_user->email, trans('emails.password_reset.content'), 'p');
$I->seeInLastEmailTo($this->_user->email, htmlentities(trans('emails.password_reset.button')), 'button');
}
示例15: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('register a user from index page');
$I->expectTo('have a users in the database');
$I->amOnPage('/');
$I->haveRecord('users', ['email' => 'andela@andela.com', 'username' => 'andelabendozy', 'password' => bcrypt('password'), 'created_at' => new DateTime(), 'updated_at' => new DateTime(), 'status' => TRUE, 'profile_state' => FALSE]);
$I->submitForm('form#register', ['name' => 'prosper', 'email' => 'andela11@andela.com', 'password' => '12345678', 'password_confirmation' => '12345678']);
$I->seeAuthentication();
$I->seeCurrentUrlEquals('');
$I->seeRecord('users', ['email' => 'andela@andela.com']);
$I->seeAuthentication();
$I->wantTo('logout');
$I->logout();
$I->dontSeeAuthentication();