本文整理汇总了PHP中FunctionalTester::grabRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::grabRecord方法的具体用法?PHP FunctionalTester::grabRecord怎么用?PHP FunctionalTester::grabRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::grabRecord方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: append_token_to_reset_password_route
private function append_token_to_reset_password_route(FunctionalTester $I)
{
// get reset token
$password_reset = $I->grabRecord('password_resets', ['email' => self::EMAIL]);
// fill password reset form
$I->amOnPage('/password/reset/' . $password_reset->token);
}
示例2: grabUser
private function grabUser(FunctionalTester $I)
{
return $I->grabRecord('users', ['id' => $this->user->id]);
}
示例3: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->resetEmails();
//setup
$I->am('a user');
$I->wantTo('activate my email adress');
$I->amAuthenticatedWithCredentials();
$I->canSeeAuthentication();
$I->amOnPage('/confirmation');
//action
//step1
$I->click('#submit-mail-code');
//step2
$I->seeInLastEmail('admin@irispass.fr');
$I->seeInLastEmail('Confirmation Code');
//step3
$I->seeRecord('users_confirmations', ['user_id' => 1, 'type' => 'mail']);
//step4
$code = $I->grabRecord('users_confirmations', ['user_id' => 1, 'type' => 'mail']);
$I->amOnPage('/confirmation/mail/' . $code->confirmation_code);
$I->dontSee('#submit-mail-code');
$I->seeRecord('users_profiles', ['user_id' => 1, 'mail_confirmed' => 1]);
示例4: 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');
示例5: FunctionalTester
<?php
/**
* Created by PhpStorm.
* User: bill
* Date: 26.01.15
* Time: 11:31
*/
use app\tests\codeception\_pages\mobile\number\CreatePage;
use app\modules\mobile\models\Number;
use app\modules\mobile\models\Document;
use app\modules\directory\models\Employee;
$I = new FunctionalTester($scenario);
$I->wantTo("ensure that creation Number model works");
$owner = $I->grabRecord(Employee::className(), ['id' => 1]);
$newDocument = 'file1.jpg';
$number = '9876543210';
$I->amGoingTo("prepare database.");
Document::deleteAll(['filename' => $newDocument]);
Number::deleteAll(['number' => $number]);
$page = CreatePage::openBy($I);
$I->dontSeeElement("input[type=file]");
$I->dontSeeElement("#documents-panel-body");
$I->dontSeeElement("#history-panel-body");
$page->submit(['number' => $number, 'ownerName' => $owner->fullName, 'ownerPost' => $owner->post, 'operatorId' => 'operator2', 'destination' => Number::DESTINATION_MODEM, 'limit' => "1000", 'options' => [Number::OPTION_ACCOUNTING, Number::OPTION_DIRECTORY], 'comment' => 'This is comment of testing number.']);
$I->SeeRecord(Number::className(), ['number' => $number, 'ownerId' => 1, 'operatorId' => 'operator2', 'destination' => Number::DESTINATION_MODEM, 'limit' => 1000, 'options' => [Number::OPTION_ACCOUNTING, Number::OPTION_DIRECTORY], 'history' => [['ownerId' => 'employee1', 'rentDate' => time()]], 'comment' => 'This is comment of testing number.']);
$I->see("Номер успешно создан", '.alert-success');
$I->seeInField($page->fieldSelector('ownerName'), $owner->fullName);
$I->seeInField($page->fieldSelector('ownerPost'), $owner->posts[1]);
$I->seeOptionIsSelected($page->fieldSelector('operatorId'), "Оператор 2");
$I->seeOptionIsSelected($page->fieldSelector('destination'), Number::DESTINATION_MODEM);
示例6: it_successfully_changes_password_from_password_change_form
public function it_successfully_changes_password_from_password_change_form(FunctionalTester $I)
{
$email = 'email@example.com';
//Existing record in DB
$resetRecord = $I->grabRecord('password_resets', ['email' => $email]);
$I->amOnPage(PasswordChangePage::$PAGE_PLAIN . $resetRecord->token);
$I->fillField('email', $email);
$I->fillField('password', '123456');
$I->fillField('password_confirmation', '123456');
$I->submitForm(PasswordChangePage::$formId, [], PasswordChangePage::$submit);
$I->see('Password successfully reset. You can now login.');
}
示例7: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('remind my password');
$user = $I->haveRecord('users', ['name' => 'Joe Doe', 'email' => 'joe@doe.com', 'password' => bcrypt('123'), 'created_at' => new DateTime(), 'updated_at' => new DateTime(), 'is_confirm' => 1]);
$I->amOnPage('/Password');
$I->fillField('email', 'joe@doe.com');
$I->click('button[type=submit]');
$I->see('Na podany adres e-mail wysłane zostały dalsze instrukcje');
$I->seeRecord('password_resets', ['email' => 'joe@doe.com']);
$record = $I->grabRecord('password_resets', ['email' => 'joe@doe.com']);
$I->amOnPage('Password/reset/' . $record->token);
$I->fillField('email', 'joe@doe.com');
$I->fillField('password', '1234');
$I->fillField('password_confirmation', '1234');
$I->click('button[type=submit]');
$I->see('Hasło zostało prawidłowo ustawione');