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


PHP AcceptanceTester::sendGet方法代码示例

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


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

示例1: proxyToGivenUriTest

 public function proxyToGivenUriTest(AcceptanceTester $I)
 {
     $expectation = PhiremockClient::on(A::getRequest()->andUrl(Is::equalTo('/potato'))->andHeader('X-Potato', Is::sameStringAs('bAnaNa'))->andScenarioState('PotatoScenario', 'Scenario.START'))->proxyTo('https://es.wikipedia.org/wiki/Proxy');
     $this->phiremock->createExpectation($expectation);
     $guzzle = new GuzzleHttp\Client();
     $originalBody = $guzzle->get('https://es.wikipedia.org/wiki/Proxy')->getBody();
     $I->haveHttpHeader('X-Potato', 'banana');
     $I->sendGet('/potato');
     $I->seeResponseEquals($originalBody);
 }
开发者ID:mcustiel,项目名称:phiremock,代码行数:10,代码来源:ProxyCest.php

示例2: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('test various search examples');
// simple search of child table
$I->sendGet('/attendees?page=1&per_page=5');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.attendees[*].id');
// complex search on child table
$I->sendGet('/attendees?page=1&per_page=5');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.attendees[*].id');
// simple search of complex table
$I->sendGet('/events?page=1&per_page=5');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.events[*].id');
// test with syntax
$I->sendGet('/events?page=1&per_page=5&with=cabins,locations,programs,sessions');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.events[*].id');
$I->seeResponseJsonMatchesJsonPath('$.locations[*].id');
$I->seeResponseJsonMatchesJsonPath('$.programs[*].id');
$I->seeResponseJsonMatchesJsonPath('$.cabins[*].id');
$I->seeResponseJsonMatchesJsonPath('$.sessions[*].id');
// test with + single individual syntax
$I->sendGet('/events/1?page=1&per_page=5&with=cabins,locations,programs,sessions');
$I->seeResponseCodeIs(200);
开发者ID:jking6884,项目名称:smores-api,代码行数:31,代码来源:SearchExamplesCept.php

示例3: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('test basic User operations');
// load a subsect of users
$I->wantTo('load a group of users');
$I->sendGet('/users?page=1&per_page=5');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.users[*].first_name');
开发者ID:jking6884,项目名称:smores-api,代码行数:10,代码来源:UserCept.php

示例4: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('test basic Account operations');
// load a subsect of accounts
$I->wantTo('load a group of accounts');
$I->sendGet('/accounts?page=1&per_page=5');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.accounts[*].created_on');
开发者ID:jking6884,项目名称:smores-api,代码行数:10,代码来源:AccountCept.php

示例5: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('test basic Location operations');
// load a subsect of locations
$I->wantTo('load a group of locations');
$I->sendGet('/locations?page=1&per_page=5');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.locations[*].name');
开发者ID:jking6884,项目名称:smores-api,代码行数:10,代码来源:LocationCept.php

示例6: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('test all end points for basic errors');
$endpoints = array('account_addrs', 'accounts', 'attendees', 'cabins', 'cards', 'charges', 'checks', 'employees', 'events', 'fees', 'locations', 'owners', 'owner_numbers', 'payments', 'registrations', 'requests', 'sessions', 'settings', 'users');
foreach ($endpoints as $endpoint) {
    $I->sendGet("{$endpoint}?limit=2");
    $I->seeResponseCodeIs(200);
    $I->seeResponseIsJson();
}
开发者ID:jking6884,项目名称:smores-api,代码行数:10,代码来源:AllEndPointsCept.php

示例7: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('test basic Program operations');
// load a subsect of programs
$I->wantTo('load a group of programs');
$I->sendGet('/programs?page=1&per_page=5');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.programs[*].name');
开发者ID:jking6884,项目名称:smores-api,代码行数:10,代码来源:ProgramCept.php

示例8: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('Test query abilities of all api end points');
$endpoints = array('addresses', 'customers', 'users');
foreach ($endpoints as $endpoint) {
    $I->sendGet("{$endpoint}?limit=2");
    $I->seeResponseCodeIs(200);
    $I->seeResponseIsJson();
    $newID = $I->grabDataFromResponseByJsonPath("\$.{$endpoint}[0].id");
    // test calling an individual resource
    $I->sendGet($endpoint . '/' . $newID[0]);
    $I->seeResponseCodeIs(200);
    $I->seeResponseIsJson();
    // test offsett
    $I->sendGet("{$endpoint}?limit=2&offset=2");
    $I->seeResponseCodeIs(200);
    $I->seeResponseIsJson();
    $I->seeResponseJsonMatchesJsonPath("\$.{$endpoint}[*].id");
    // run searches side loading all records
    $I->sendGet("{$endpoint}?limit=2&offset=2&with=all");
    $I->seeResponseCodeIs(200);
    $I->seeResponseIsJson();
    $I->seeResponseJsonMatchesJsonPath("\$.{$endpoint}[*].id");
    // run searches with NO side loaded records
    $I->sendGet("{$endpoint}?limit=2&offset=2&with=none");
    $I->seeResponseCodeIs(200);
    $I->seeResponseIsJson();
    $I->seeResponseJsonMatchesJsonPath("\$.{$endpoint}[*].id");
}
开发者ID:phalcon-id,项目名称:phalcon-json-api,代码行数:30,代码来源:AllQueriesCept.php


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