當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FunctionalTester::getApplication方法代碼示例

本文整理匯總了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);
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:14,代碼來源:ExportProjectIssueCest.php

示例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);
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:15,代碼來源:OtherFunctionalCest.php

示例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);
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:27,代碼來源:CrudIssueCommentCest.php

示例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);
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:24,代碼來源:ProjectCest.php

示例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 . '"]');
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:26,代碼來源:CrudProjectNotesCest.php

示例6: _before

 public function _before(FunctionalTester $I)
 {
     $this->app = $I->getApplication();
     $this->app->register('Inoplate\\Account\\Providers\\AccountServiceProvider');
 }
開發者ID:inoplate,項目名稱:account,代碼行數:5,代碼來源:AuthCest.php

示例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');
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:25,代碼來源:IssueCest.php

示例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);
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:32,代碼來源:CrudAttachmentCest.php


注:本文中的FunctionalTester::getApplication方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。