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


PHP FunctionalTester::seeResponseCodeIs方法代碼示例

本文整理匯總了PHP中FunctionalTester::seeResponseCodeIs方法的典型用法代碼示例。如果您正苦於以下問題:PHP FunctionalTester::seeResponseCodeIs方法的具體用法?PHP FunctionalTester::seeResponseCodeIs怎麽用?PHP FunctionalTester::seeResponseCodeIs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FunctionalTester的用法示例。


在下文中一共展示了FunctionalTester::seeResponseCodeIs方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checkAuthEndpoint

 public function checkAuthEndpoint(FunctionalTester $I)
 {
     $I->wantTo('Visit login endpoint');
     $I->amOnPage('login');
     $I->seeResponseCodeIs(200);
     $I->wantTo('Visit register endpoint');
     $I->amOnPage('register');
     $I->seeResponseCodeIs(200);
 }
開發者ID:inoplate,項目名稱:account,代碼行數:9,代碼來源:AuthCest.php

示例2: updateIssue

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function updateIssue(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('edit an existing project issue details');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     // developer
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$developer1]);
     $I->amOnAction('Project\\IssueController@getNew', ['project' => $project]);
     $issue = $I->createIssue(1, $admin, $developer1, $project);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->seeLink('Issue 1');
     $I->dontSee(\Html::duration($issue->time_quote), '.issue-quote');
     $I->click('Issue 1', '.edit-issue');
     $I->seeCurrentActionIs('Project\\IssueController@getEdit', ['project' => $project, 'issue' => $issue]);
     $newTitle = 'Issue 1 update';
     $newTime = 3700;
     $I->fillField('title', $newTitle);
     $I->fillField('time_quote[h]', 1);
     $I->fillField('time_quote[s]', 100);
     $I->fillField('tag', 'type:tag1');
     $I->click(trans('tinyissue.update_issue'));
     $I->seeResponseCodeIs(200);
     $I->seeCurrentActionIs('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->seeLink($newTitle);
     $I->see(\Html::duration($newTime), '.issue-quote');
     $I->see('type', '.issue-tag');
     $I->see('tag1', '.issue-tag');
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:37,代碼來源:CrudIssueCest.php

示例3: tryingToCreateWithEmptyContent

 public function tryingToCreateWithEmptyContent(FunctionalTester $I)
 {
     $I->disableMiddleware();
     $I->amOnRoute('microblog.home');
     $I->sendAjaxPostRequest(route('microblog.save'), array('text' => ''));
     // POST
     $I->seeResponseCodeIs(422);
 }
開發者ID:furious-programming,項目名稱:coyote,代碼行數:8,代碼來源:MicroblogsCest.php

示例4: ResponseOfInvalidSourceIsJson

 public function ResponseOfInvalidSourceIsJson(Tester $I)
 {
     $I->wantToTest('response is JSON if we provide an Invalid Source');
     $I->haveHttpHeader("apikey", $this->apiInfo[Helper::CSV_ORDER_APIKEY]);
     $I->sendGET("currenttime", ["source" => 'blahblahblah']);
     $I->seeResponseCodeIs(401);
     $I->seeResponseIsJson();
 }
開發者ID:parisqian-misa,項目名稱:NTUC-API,代碼行數:8,代碼來源:CurrenttimeCest.php

示例5: updateItem

 public function updateItem(FunctionalTester $I, $scenario)
 {
     $I->wantTo('modify an existing item');
     $I->sendPUT('/vehicles/123', ['name' => 'Pansy updated']);
     $scenario->incomplete('work in progress');
     $I->seeResponseCodeIs(200);
     $I->seeResponseIsJson();
     $I->seeResponseContainsJson(['id' => 123, 'name' => 'Pansy updated']);
 }
開發者ID:tekkie,項目名稱:autolog-api,代碼行數:9,代碼來源:VehiclesCest.php

示例6: it_should_insert_a_comment_when_hitting_the_endpoint_with_valid_params

 /**
  * @test
  * it should insert a comment when hitting the endpoint with valid params
  */
 public function it_should_insert_a_comment_when_hitting_the_endpoint_with_valid_params(\FunctionalTester $I)
 {
     $post_id = $I->havePostInDatabase(['post_title' => 'Some post']);
     $I->amOnPage('/');
     $wp_rest_nonce = $I->grabValueFrom('input[name="rest_nonce"]');
     $I->haveHttpHeader('X-WP-Nonce', $wp_rest_nonce);
     $I->sendAjaxPostRequest('/wp-json/idlikethis/v1/button-click', ['post_id' => $post_id, 'content' => 'Some Content']);
     $I->seeResponseCodeIs(200);
     $I->seeCommentInDatabase(['comment_post_ID' => $post_id]);
 }
開發者ID:lucatume,項目名稱:idlikethis,代碼行數:14,代碼來源:ButtonClickPostRequestCest.php

示例7: requireAuthenticationForRoute

 public function requireAuthenticationForRoute(FunctionalTester $I)
 {
     $I->haveEnabledFilters();
     $I->amOnPage('/secure');
     $I->seeCurrentUrlEquals('/auth/login');
     $I->see('Login');
     $I->amLoggedAs(User::create($this->userAttributes));
     $I->amOnPage('/secure');
     $I->seeResponseCodeIs(200);
     $I->see('Hello World');
 }
開發者ID:resulaslan,項目名稱:sample-l4-app,代碼行數:11,代碼來源:AuthCest.php

示例8: _assertExport

 /**
  * @param FunctionalTester $I
  * @param Project          $project
  * @param array            $issues1
  * @param array            $issues2
  *
  * @return void
  */
 protected function _assertExport(FunctionalTester $I, Project $project, array $issues1, array $issues2)
 {
     $I->seeResponseCodeIs(200);
     array_walk($issues1, function ($issue) use($I) {
         $I->see($issue->title);
     });
     $I->see($project->name);
     array_walk($issues2, function ($issue) use($I) {
         $I->dontSee($issue->title);
     });
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:19,代碼來源:ExportProjectIssueCest.php

示例9: requireAuthenticationForRoute

 public function requireAuthenticationForRoute(FunctionalTester $I)
 {
     $I->dontSeeAuthentication();
     $I->amOnPage('/secure');
     $I->seeCurrentUrlEquals('/auth/login');
     $I->see('Login');
     $I->amLoggedAs(User::firstOrNew($this->userAttributes));
     $I->amOnPage('/secure');
     $I->seeResponseCodeIs(200);
     $I->see('Hello World');
 }
開發者ID:jenky,項目名稱:laravel-api-starter,代碼行數:11,代碼來源:AuthCest.php

示例10: it_should_reset_comments_when_post_id_is_valid

 /**
  * @test
  * it should reset comments when post id is valid
  */
 public function it_should_reset_comments_when_post_id_is_valid(\FunctionalTester $I)
 {
     $post_id = $I->havePostInDatabase();
     $comment_ids = $I->haveManyCommentsInDatabase(3, $post_id, ['comment_type' => 'idlikethis']);
     $I->loginAsAdmin();
     $I->amEditingPostWithId($post_id);
     $wp_rest_nonce = $I->grabValueFrom('input[name="rest_nonce"]');
     $I->haveHttpHeader('X-WP-Nonce', $wp_rest_nonce);
     $I->sendAjaxPostRequest('/wp-json/idlikethis/v1/admin/reset-all', ['post_id' => $post_id]);
     $I->seeResponseCodeIs(200);
     foreach ($comment_ids as $comment_id) {
         $I->dontSeeCommentInDatabase(['comment_ID' => $comment_id, 'comment_post_ID' => $post_id]);
     }
 }
開發者ID:lucatume,項目名稱:idlikethis,代碼行數:18,代碼來源:ResetAllPostRequestCest.php

示例11: it_should_consolidate_comments_when_post_id_is_valid_and_user_can_edit_posts

 /**
  * @test
  * it should consolidate comments when post id is valid and user can edit posts
  */
 public function it_should_consolidate_comments_when_post_id_is_valid_and_user_can_edit_posts(\FunctionalTester $I)
 {
     $post_id = $I->havePostInDatabase();
     $comment_ids = $I->haveManyCommentsInDatabase(3, $post_id, ['comment_type' => 'idlikethis', 'comment_content' => '{{n}} - foo']);
     $I->loginAsAdmin();
     $I->amEditingPostWithId($post_id);
     $wp_rest_nonce = $I->grabValueFrom('input[name="rest_nonce"]');
     $I->haveHttpHeader('X-WP-Nonce', $wp_rest_nonce);
     $I->sendAjaxPostRequest('/wp-json/idlikethis/v1/admin/consolidate-all', ['post_id' => $post_id]);
     $I->seeResponseCodeIs(200);
     foreach ($comment_ids as $comment_id) {
         $I->dontSeeCommentInDatabase(['comment_ID' => $comment_id, 'comment_post_ID' => $post_id]);
     }
     $I->seePostMetaInDatabase(['post_id' => $post_id, 'meta_key' => '_idlikethis_votes', 'meta_value' => serialize(['foo' => 3])]);
 }
開發者ID:lucatume,項目名稱:idlikethis,代碼行數:19,代碼來源:ConsolidateAllPostRequestCest.php

示例12: 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

示例13: memberCantAddCash

 public function memberCantAddCash(FunctionalTester $I)
 {
     $I->am('a member');
     $I->wantTo('make sure I cant add cash payments to my account');
     //Load and login a known member
     $user = User::find(1);
     Auth::login($user);
     //I cant see option
     $I->amOnPage('/account/' . $user->id . '');
     $I->cantSee('Record a cash balance payment');
     //Make sure they cant post payment directly
     //Confirm that posting directly generates a validation exception
     $I->sendPOST('/account/' . $user->id . '/payment/cash/create', ['reason' => 'balance', 'amount' => 4.69, 'return_path' => '/']);
     $I->seeResponseCodeIs(403);
     //One final check
     $I->cantSeeInDatabase('payments', ['amount' => 4.69]);
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:17,代碼來源:MemberCest.php

示例14: 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

示例15: cantEditClosedIssue

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function cantEditClosedIssue(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('not be able to edit closed issue');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     // developer
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$developer1]);
     $issue = $I->createIssue(1, $admin, $developer1, $project);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->click('Issue 1', '.edit-issue');
     $I->seeCurrentActionIs('Project\\IssueController@getEdit', ['project' => $project, 'issue' => $issue]);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->click(trans('tinyissue.close_issue'), '.close-issue');
     $I->seeLink(trans('tinyissue.reopen_issue'));
     $I->click('Issue 1', '.edit-issue');
     $I->seeResponseCodeIs(200);
     $I->seeCurrentActionIs('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->see(trans('tinyissue.cant_edit_closed_issue'));
 }
開發者ID:oliverpool,項目名稱:tinyissue,代碼行數:28,代碼來源:IssueCest.php


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