本文整理汇总了PHP中FunctionalTester::dontSeeRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::dontSeeRecord方法的具体用法?PHP FunctionalTester::dontSeeRecord怎么用?PHP FunctionalTester::dontSeeRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::dontSeeRecord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginUsingBadLdapCredentials
public function loginUsingBadLdapCredentials(FunctionalTester $I)
{
$I->dontSeeAuthentication();
$I->dontSeeRecord('users', $this->userAttributes);
LoginPage::of($I)->loginByCredentials(env('LDAP_ADMIN_USER'), 'foo');
$I->dontSeeRecord('users', $this->userAttributes);
$I->dontSeeAuthentication();
}
示例2: 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');
}
示例3: deleteProject
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function deleteProject(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('delete an existing project details');
$project = $I->createProject(1);
$admin = $I->createUser(1, 4);
$I->amLoggedAs($admin);
$I->amOnAction('ProjectController@getEdit', ['project' => $project]);
$I->click(trans('tinyissue.delete_something', ['name' => $project->name]));
$I->seeCurrentActionIs('ProjectsController@getIndex');
$I->dontSeeLink('Project 1');
$I->amOnAction('ProjectsController@getIndex', ['status' => Project::STATUS_ARCHIVED]);
$I->dontSeeLink('Project 1');
$I->dontSeeRecord($project->getTable(), ['name' => 'Project 1']);
}
示例4: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->am('a CMS admin');
$I->wantTo('delete a section');
// When
$id = $I->haveSection();
// And
$I->amOnPage('admin/sections/' . $id);
// Then
$I->see('Delete section', 'button.btn-del');
// When
$I->click('Delete section');
// Then
$I->seeCurrentUrlEquals('/admin/sections');
$I->dontSeeRecord('sections', ['id' => $id]);
示例5: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('create a category');
$I->am('knowledge admin');
$I->amOnPage('/categories/create');
$I->seeInTitle('Create category');
// form empty
$I->amGoingTo('test validation');
$I->click('Create');
$I->dontSeeRecord('categories', []);
$I->seeCurrentUrlEquals('/categories/create');
$I->see('The name field is required');
$I->see('The slug field is required');
// only empty name
$I->amGoingTo('test name validation');
$I->fillField('slug', 'libro');
$I->fillField('active', 1);
$I->click('Create');
$I->dontSeeRecord('categories', ['slug' => 'libro', 'active' => 1]);
$I->seeCurrentUrlEquals('/categories/create');
$I->see('The name field is required', '.error');
$I->seeInField('slug', 'libro');
$I->dontSee('The slug field is required');
// all form filled
$I->fillField('name', 'Libro');
$I->fillField('slug', 'libro');
$I->fillField('active', 1);
$I->click('Create');
$I->haveRecord('categories', ['name' => 'Libro', 'slug' => 'libro', 'active' => 1]);
$I->seeCurrentUrlEquals('/categories');
示例6: deactivate_user
public function deactivate_user(FunctionalTester $I)
{
$I->am('Admin');
$I->wantTo('deactivate a user');
$I->expectTo('see that the user has been deactivated');
/***************************************************************************************************************
* settings
**************************************************************************************************************/
// we create the admin role
$admin_role = $this->_createAdminRole();
$admin_role->users()->attach($this->_user);
// we create another user
$credentials = ['last_name' => 'Autre', 'first_name' => 'autre', 'email' => 'autre@autre.fr', 'password' => 'autre'];
$user = \Sentinel::register($credentials, true);
/***************************************************************************************************************
* run test
**************************************************************************************************************/
$I->amOnPage('/');
$I->amOnRoute('users.index');
$I->uncheckOption('#activate_' . $user->id);
$I->submitForm('#form_activate_' . $user->id, []);
$I->seeResponseCodeIs(200);
// $I->see(strip_tags(trans('users.message.activation.success.label', ['action' => trans_choice('users.message.activation.success.action', false), 'name' => $user->first_name . ' ' . $user->last_name])));
$I->dontSeeRecord('activations', ['user_id' => $user->id, 'completed' => true]);
}
示例7: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->resetEmails();
//setup
$I->am('a user');
$I->wantTo('activate my email adress with expired code');
$I->amAuthenticatedWithCredentials();
$I->canSeeAuthentication();
$I->haveRecord('users_confirmations', ['type' => 'mail', 'confirmation_code' => 'KGcClDwrpbZn2XwHJbBTcqf28GrY5O', 'user_id' => 1, 'created_at' => '2015-05-08 00:00:00', 'updated_at' => '2015-05-08 00:00:00']);
//step4
$code = $I->grabRecord('users_confirmations', ['user_id' => 1, 'type' => 'mail']);
$I->amOnPage('/confirmation/mail/' . $code->confirmation_code);
$I->seeElement('#submit-mail-code');
$I->dontSeeRecord('users_profiles', ['user_id' => 1, 'mail_confirmed' => 1]);
示例8: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('register a user');
$I->amOnPage('/register');
$I->fillField('name', 'Jo');
$I->fillField('email', 'example');
$I->fillField('password', 'pass');
$I->fillField('password_confirmation', 'pass');
$I->click('button[type=submit]');
$I->seeFormHasErrors();
$I->seeCurrentUrlEquals('/register');
$I->seeFormErrorMessages(array('email' => 'The email must be a valid email address.', 'name' => 'The name must be at least 3 characters.', 'password' => 'The password must be at least 8 characters.'));
$I->dontSeeRecord('users', ['email' => 'example']);
$I->expectTo('register a user with a mismatching password');
$I->fillField('name', 'Johndoe');
$I->fillField('email', 'example@example.com');
$I->fillField('password', 'passee');
$I->fillField('password_confirmation', 'pass');
$I->click('button[type=submit]');
$I->seeFormHasErrors();
$I->seeCurrentUrlEquals('/register');
$I->seeFormErrorMessage('password', 'The password confirmation does not match.');
$I->dontSeeRecord('users', ['email' => 'example@example.com']);
$I->expectTo('register a user with existing username and email');
$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->fillField('name', 'andelabendozy');
$I->fillField('email', 'andela@andela.com');
$I->fillField('password', 'password');
$I->fillField('password_confirmation', 'password');
$I->click('button[type=submit]');
示例9: FunctionalTester
/**
* ------------------------------------
* Attenting a topic
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Attent a Topic discussion as a visitor and a menber.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// --------------- As a visitor --------------
$I->am('as a Visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->click('#topic-attent-button');
$I->seeCurrentUrlEquals('/login-required');
// --------------- As a member --------------
$user = $I->signIn();
$I->am('as a Member');
// -- attent
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-attent-button');
$I->click('#topic-attent-button');
$I->see('My Awsome Topic.');
$I->seeRecord('attentions', ['topic_id' => $topic->id, 'user_id' => $user->id]);
// -- cancel attent
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-attent-cancel-button');
$I->click('#topic-attent-cancel-button');
$I->see('My Awsome Topic.');
$I->dontSeeRecord('attentions', ['topic_id' => $topic->id, 'user_id' => $user->id]);
示例10: 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]);
示例11: FunctionalTester
<?php
/**
* Created by PhpStorm.
* User: bill
* Date: 16.02.15
* Time: 16:06
*/
use app\modules\mobile\models\Document;
Document::deleteAll();
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that remove document works');
$id = Document::getCollection()->insertFile(\Yii::getAlias('@data') . '/file1.jpg');
$I->seeRecord(Document::className(), ['_id' => $id]);
$I->amOnPage(['mobile/number/detach-document', 'id' => (string) $id]);
$I->dontSeeRecord(Document::className(), ['_id' => $id]);
示例12: FunctionalTester
/**
* ------------------------------------
* Topic deletion
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Delete a topic as a visitor, normal member and admin.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// Testing as a visitor
$I->am('a Phphub visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-delete-button');
$I->amOnRoute('topics.delete', $topic->id);
$I->seeCurrentRouteIs('login-required');
// Test as a normal member
$I->am('a Phphub member');
$I->signIn();
$I->amOnRoute('topics.show', $topic->id);
$I->dontSeeElement('#topic-delete-button');
$I->amOnRoute('topics.delete', $topic->id);
$I->seeCurrentRouteIs('admin-required');
// Testing as a admin user
$I->am('a Phphub admin');
$I->signInAsAdmin();
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-delete-button');
$I->click('#topic-delete-button');
$I->seeCurrentRouteIs('topics');
$I->dontSeeRecord('topics', ['id' => $topic->id]);
示例13: FunctionalTester
/**
* ------------------------------------
* Favorite a topic
* ------------------------------------
*/
$I = new FunctionalTester($scenario);
Route::enableFilters();
$I->wantTo('Favorite a Topic as a visitor and a menber.');
$topic = $I->postATopic(['title' => 'My Awsome Topic.']);
// --------------- As a visitor --------------
$I->am('as a Visitor');
$I->amOnRoute('topics.show', $topic->id);
$I->click('#topic-favorite-button');
$I->seeCurrentUrlEquals('/login-required');
// --------------- As a member --------------
$user = $I->signIn();
$I->am('as a Member');
// -- favorite
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-favorite-button');
$I->click('#topic-favorite-button');
$I->see('My Awsome Topic.');
$I->seeRecord('favorites', ['topic_id' => $topic->id, 'user_id' => $user->id]);
// -- cancel favorite
$I->amOnRoute('topics.show', $topic->id);
$I->seeElement('#topic-favorite-cancel-button');
$I->click('#topic-favorite-cancel-button');
$I->see('My Awsome Topic.');
$I->dontSeeRecord('favorites', ['topic_id' => $topic->id, 'user_id' => $user->id]);
示例14: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('flush old devices');
$piOne = ['ip' => '192.168.1.101', 'mac' => '11:22:33:44:55:66', 'name' => 'Awesome Pi One', 'created_at' => (new \Carbon\Carbon())->subHour()->toDateTimeString(), 'updated_at' => (new \Carbon\Carbon())->subHour()->toDateTimeString()];
$I->haveRecord('devices', $piOne);
$piTwo = ['ip' => '192.168.1.102', 'mac' => '11:22:33:44:55:67', 'name' => 'Awesome Pi Two', 'created_at' => (new \Carbon\Carbon())->subHour()->toDateTimeString(), 'updated_at' => (new \Carbon\Carbon())->now()->toDateTimeString()];
$I->haveRecord('devices', $piTwo);
$I->assertEquals(2, \PiFinder\Device::count());
$I->runConsoleCommand('pi:flush');
$I->assertEquals(1, \PiFinder\Device::count());
$I->dontSeeRecord('devices', $piOne);
$I->seeRecord('devices', $piTwo);
示例15: 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]);
}