本文整理汇总了PHP中FunctionalTester::amOnAction方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::amOnAction方法的具体用法?PHP FunctionalTester::amOnAction怎么用?PHP FunctionalTester::amOnAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::amOnAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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']);
}
示例2: updateTag
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function updateTag(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('edit an existing tag');
$tag = (new Tag())->where('group', '=', false)->get()->random(1);
$data = ['name' => 'tag updated'];
$tagName = $tag->name;
$I->amLoggedAs($I->createUser(1, 4));
$I->amOnAction('Administration\\TagsController@getIndex');
$I->click($this->_editTagSelector($tagName));
$I->seeCurrentActionIs('Administration\\TagsController@getEdit', ['tag' => $tag]);
$I->submitForm('form', $data);
$I->amOnAction('Administration\\TagsController@getIndex');
$I->see($data['name'], $this->_editTagSelector($data['name']));
$I->dontSee($data['name'], $this->_editTagSelector($tagName));
}
示例3: invalidUsernamePassword
/**
* @param FunctionalTester $I
*
* @return void
*/
public function invalidUsernamePassword(FunctionalTester $I)
{
$I->wantTo('login with invalid username/password');
$I->amOnAction('HomeController@getIndex');
$I->dontSeeAuthentication();
$I->see('Login');
$I->fillField('Email', 'user@user.com');
$I->fillField('Password', '1234');
$I->click('Login');
$I->dontSeeAuthentication();
}
示例4: deleteComment
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function deleteComment(FunctionalTester $I)
{
$I->am('Developer User');
$I->wantTo('delete a comment from an issue');
$admin = $I->createUser(2, 4);
$I->amLoggedAs($admin);
$project = $I->createProject(1, [$admin]);
$issue = $I->createIssue(1, $admin, $admin, $project);
$comment1 = $I->createComment(1, $admin, $issue);
$comment2 = $I->createComment(2, $admin, $issue);
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->see($comment1->comment, '#comment' . $comment1->id . ' .content');
$I->see($comment2->comment, '#comment' . $comment2->id . ' .content');
$uri = $I->getApplication()->url->action('Project\\IssueController@getDeleteComment', ['comment' => $comment1]);
$I->sendAjaxGetRequest($uri);
$I->seeResponseCodeIs(200);
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->dontSee($comment1->comment);
$I->see($comment2->comment);
}
示例5: _downloadExport
/**
* @param FunctionalTester $I
* @param Project $project
*
* @return void
*/
protected function _downloadExport(FunctionalTester $I, Project $project)
{
$response = $I->getJsonResponseContent();
$file = $response->file;
if ($response->ext !== 'csv') {
\Excel::load(storage_path('exports/' . $response->file))->store('csv');
unlink(storage_path('exports/' . $response->file));
$file = str_replace('.' . $response->ext, '.csv', $response->file);
}
$I->amOnAction('ProjectController@getDownloadExport', ['project' => $project, 'file' => $file]);
}
示例6: deleteUser
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function deleteUser(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('delete an existing user details');
$admin = $I->createUser(1, 4);
$user = $I->createUser(2, 1);
$user1 = $I->createUser(3, 2);
$I->amLoggedAs($admin);
$I->amOnAction('Administration\\UsersController@getDelete', ['user' => $user]);
$I->seeCurrentActionIs('Administration\\UsersController@getIndex');
$I->dontSee($user->fullname);
$I->see($user1->fullname);
}
示例7: viewInvalidNote
public function viewInvalidNote(FunctionalTester $I)
{
$I->am('Normal User');
$I->expectTo('see 401 error with mismatch note route parameters.');
$admin = $I->createUser(1, 4);
// admin
$project1 = $I->createProject(1, [$admin]);
$project2 = $I->createProject(2, [$admin]);
$note1 = $I->createNote(1, $admin, $project1);
$I->amLoggedAs($admin);
$I->amOnAction('ProjectController@getNotes', ['project' => $project1]);
$uri = $I->getApplication()->url->action('ProjectController@postEditNote', ['project' => $project2, 'note' => $note1], false);
$I->sendAjaxPostRequest($uri, ['body' => 'note one updated', '_token' => csrf_token()]);
$I->seeResponseCodeIs(401);
}
示例8: deleteNote
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function deleteNote(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('delete an existing note from a project');
$admin = $I->createUser(1, 4);
$I->amLoggedAs($admin);
$project = $I->createProject(1);
$note1 = $I->createNote(1, $admin, $project);
$note2 = $I->createNote(2, $admin, $project);
$I->amOnAction('ProjectController@getNotes', ['project' => $project]);
$I->see('Note 1', '//li[@id="note' . $note1->id . '"]');
$I->see('Note 2', '//li[@id="note' . $note2->id . '"]');
$uri = $I->getApplication()->url->action('ProjectController@getDeleteNote', ['project' => $project, 'note' => $note2]);
$I->sendAjaxGetRequest($uri);
$I->seeResponseCodeIs(200);
$I->amOnAction('ProjectController@getNotes', ['project' => $project]);
$I->see('Note 1', '//li[@id="note' . $note1->id . '"]');
$I->dontSee('Note 2', '//li[@id="note' . $note2->id . '"]');
}
示例9: viewOverview
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function viewOverview(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('To view administration overview page');
$admin = $I->createUser(1, 4);
$project1 = $I->createProject(1);
$project2 = $I->createProject(2);
$project2->status = Tinyissue\Model\Project::STATUS_ARCHIVED;
$project2->save();
$I->createProject(3);
$I->createIssue(1, $admin, null, $project1);
$I->createIssue(2, $admin, null, $project1);
$issue3 = $I->createIssue(3, $admin, null, $project1);
$issue3->changeStatus(Project\Issue::STATUS_CLOSED, $admin);
$I->amLoggedAs($admin);
$I->amOnAction('HomeController@getIndex');
$I->click(trans('tinyissue.administration'));
$I->seeCurrentActionIs('AdministrationController@getIndex');
$I->see('1', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.total_users') . '\')]]/span');
$I->see('2', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.active_projects') . '\')]]/span');
$I->see('1', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.archived_projects') . '\')]]/span');
$I->see('2', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.open_issues') . '\')]]/span');
$I->see('1', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.closed_issues') . '\')]]/span');
}
示例10: 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');
示例11: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->am('an user');
$I->wantTo('Create a group');
//setup
$I->amAuthenticatedWithCredentials();
$I->amOnAction('GroupsController@create');
//modify user
$I->fillField(['name' => 'name'], 'group test');
$I->click('submit-osjs-groups-create');
$I->amOnPage(action('UsersManagementController@index'));
$I->canSee('group test');
示例12: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->am('an user');
$I->wantTo('Update my profile');
//setup
$I->amAuthenticatedWithCredentials();
$I->amOnAction('ProfileController@edit');
$user = \App\User::find(1);
//save
$_email = $user->email;
$_firstname = $user->profile->firstname;
$_lastname = $user->profile->lastname;
$_phone = $user->profile->phone;
//modify user
$I->fillField(['name' => 'email'], 'johndoe@foe.com');
$I->fillField(['id' => 'firstname'], 'John');
$I->fillField(['id' => 'lastname'], 'Doe');
$I->fillField(['id' => 'phone'], '+33616391876');
$I->click('submit-edit');
$I->cantSeeInField(['name' => 'email'], $_email);
$I->cantSeeInField(['id' => 'firstname'], $_firstname);
$I->cantSeeInField(['id' => 'lastname'], $_lastname);
$I->cantSeeInField(['id' => 'phone'], $_phone);
//reset user test
$I->fillField(['name' => 'email'], $_email);
$I->fillField(['id' => 'firstname'], $_firstname);
$I->fillField(['id' => 'lastname'], $_lastname);
$I->fillField(['id' => 'phone'], $_phone);
$I->click('submit-edit');
$I->seeInDatabase('users', ['email' => $_email]);
示例13: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->am('an user');
$I->wantTo('Update an user');
//setup
$I->amAuthenticatedWithCredentials();
$I->amOnAction('UsersManagementController@index');
$I->click("//*[text()[contains(.,'Alexandre')]]/following-sibling::td[4]/a[1]");
$I->click("Editer");
//modify user
$I->fillField(['name' => 'profile[firstname]'], 'john');
$I->fillField(['name' => 'profile[lastname]'], 'johna');
$I->click('submit-osjs-users-create');
$I->amOnAction('UsersManagementController@index');
//$I->see('john');
示例14: assignToUser
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function assignToUser(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('not be able to assign an issue to a user');
$admin = $I->createUser(1, 4);
$developer1 = $I->createUser(2, 2);
// developer
$I->amLoggedAs($admin);
$project = $I->createProject(1, [$developer1]);
$issue = $I->createIssue(1, $admin, null, $project);
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->dontSee($developer1->fullname, '.assigned-to .currently_assigned');
$uri = $I->getApplication()->url->action('Project\\IssueController@postAssign', ['project' => $project]);
$I->sendAjaxPostRequest($uri, ['user_id' => $developer1->id, '_token' => csrf_token()]);
$I->comment($I->getResponseContent());
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->see($developer1->fullname, '.assigned-to .currently_assigned');
}
示例15: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->am('an user');
$I->wantTo('Create an user');
//setup
$I->amAuthenticatedWithCredentials();
$I->amOnAction('UsersController@create');
//modify user
$I->fillField(['name' => 'profile[firstname]'], 'josh');
$I->fillField(['name' => 'profile[lastname]'], 'josh');
$I->fillField(['name' => 'password'], '123123');
$I->fillField(['name' => 'password_confirmation'], '123123');
$I->click('submit-osjs-users-create');
//$I->canSee('josh');