本文整理汇总了PHP中FunctionalTester::getApplication方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::getApplication方法的具体用法?PHP FunctionalTester::getApplication怎么用?PHP FunctionalTester::getApplication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::getApplication方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _exportIssues
/**
* @param FunctionalTester $I
* @param Project $project
* @param array $params
*
* @return void
*/
protected function _exportIssues(FunctionalTester $I, Project $project, array $params)
{
$I->amOnAction('ProjectController@getIndex', ['project' => $project]);
$uri = $I->getApplication()->url->action('ProjectController@postExportIssues', ['project' => $project]);
$I->sendAjaxPostRequest($uri, array_merge(['_token' => csrf_token(), 'keyword' => '', 'assignto' => '', 'tags' => ''], $params));
$I->seeResponseCodeIs(200);
}
示例2: 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);
}
示例3: 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);
}
示例4: removeUserFromProject
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function removeUserFromProject(FunctionalTester $I)
{
$I->am('Admin User');
$I->wantTo('not be able to remove user to a project');
$admin = $I->createUser(1, 4);
$developer1 = $I->createUser(2, 2);
// developer
$I->amLoggedAs($admin);
$project = $I->createProject(1, [$developer1]);
$I->amOnAction('ProjectController@getIndex', ['project' => $project]);
$I->see($developer1->fullname, '#project-user' . $developer1->id);
$uri = $I->getApplication()->url->action('ProjectController@postUnassign', ['project' => $project]);
$I->sendAjaxPostRequest($uri, ['user_id' => $developer1->id, '_token' => csrf_token()]);
$I->seeResponseCodeIs(200);
$I->amOnAction('ProjectController@getIndex', ['project' => $project]);
$I->dontSee($developer1->fullname, '#project-user' . $developer1->id);
}
示例5: 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 . '"]');
}
示例6: _before
public function _before(FunctionalTester $I)
{
$this->app = $I->getApplication();
$this->app->register('Inoplate\\Account\\Providers\\AccountServiceProvider');
}
示例7: 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');
}
示例8: removeAttachment
/**
* @param FunctionalTester $I
*
* @actor FunctionalTester
*
* @return void
*/
public function removeAttachment(FunctionalTester $I)
{
$I->am('Manager User');
$I->wantTo('remove an attachment from a project issue comments');
$fileName = 'upload1.txt';
$manager = $I->createUser(1, 3);
$I->amLoggedAs($manager);
$issue = $I->createIssue(1, $manager);
$project = $issue->project;
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$uploadToken = $I->grabValueFrom('//form/input[@name="upload_token"]');
$uri = $I->getApplication()->url->action('Project\\IssueController@postUploadAttachment', ['project' => $project]);
$I->submitFormWithFileToUri('.new-comment form', $uri, ['upload' => $fileName], ['comment' => 'Comment 1']);
$attachment = $issue->comments->first()->attachments->first();
$I->amOnAction('Project\\IssueController@getDownloadAttachment', ['project' => $project, 'issue' => $issue, 'attachment' => $attachment]);
$I->seeResponseCodeIs(200);
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->seeElement('.attachments a', ['title' => $fileName]);
$uri = $I->getApplication()->url->action('Project\\IssueController@postRemoveAttachment', ['project' => $project]);
$I->sendAjaxPostRequest($uri, ['_token' => csrf_token(), 'upload_token' => $uploadToken, 'filename' => $fileName]);
$I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->dontSeeElement('.attachments a', ['title' => $fileName]);
$I->amOnAction('Project\\IssueController@getDisplayAttachment', ['project' => $project, 'issue' => $issue, 'attachment' => $attachment]);
$I->seeResponseCodeIs(404);
}