当前位置: 首页>>代码示例>>PHP>>正文


PHP FunctionalTester::haveHttpHeader方法代码示例

本文整理汇总了PHP中FunctionalTester::haveHttpHeader方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::haveHttpHeader方法的具体用法?PHP FunctionalTester::haveHttpHeader怎么用?PHP FunctionalTester::haveHttpHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FunctionalTester的用法示例。


在下文中一共展示了FunctionalTester::haveHttpHeader方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: NotGetting500

 public function NotGetting500(Tester $I)
 {
     $I->wantToTest('whether we are getting any 500 error');
     $I->haveHttpHeader("apikey", $this->apiInfo[Helper::CSV_ORDER_APIKEY]);
     $I->sendGET("currenttime", ["source" => $this->apiInfo[Helper::CSV_ORDER_SOURCE]]);
     $I->dontSeeResponseCodeIs(500);
 }
开发者ID:parisqian-misa,项目名称:NTUC-API,代码行数:7,代码来源:CurrenttimeCest.php

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

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

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

示例5: _before

 public function _before(FunctionalTester $I)
 {
     Artisan::call('db:truncate');
     $I->haveHttpHeader('Accept', 'application/json');
 }
开发者ID:jp7internet,项目名称:laravel-apz,代码行数:5,代码来源:AuthorControllerCest.php

示例6: OtherVerb

 public function OtherVerb(Tester $I)
 {
     $time = time();
     $I->wantTo('Test invalid Verb');
     $I->haveHttpHeader("apikey", $this->apikey);
     $I->haveHttpHeader("timestamp", $time);
     $I->haveHttpHeader("fingerprint", Helper::createFingerPrint($this->apikey, $this->secret, $time, 'POST', $this->resourceURL, $this->nric, $this->amount, $this->date, $this->source));
     $I->haveHttpHeader("Content-Type", 'application/x-www-form-urlencoded');
     $I->sendOPTIONS("updates", Helper::assemblePostData($this->nric, $this->amount, $this->date, $this->source));
     $I->seeResponseCodeIs(405);
 }
开发者ID:parisqian-misa,项目名称:NTUC-API,代码行数:11,代码来源:UpdatesCest.php


注:本文中的FunctionalTester::haveHttpHeader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。