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


PHP ApiTester::seeResponseJsonMatchesJsonPath方法代碼示例

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


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

示例1: checkGenericLoginData

 private function checkGenericLoginData()
 {
     $this->tester->seeResponseJsonMatchesJsonPath('$.status');
     $this->tester->seeResponseJsonMatchesJsonPath('$.data.username');
     $this->tester->seeResponseJsonMatchesJsonPath('$.data.email');
     $this->tester->seeResponseJsonMatchesJsonPath('$.data.registrationId');
 }
開發者ID:excrucio,項目名稱:RSC2015R-returnCaca,代碼行數:7,代碼來源:TestApiLoginLogoutTest.php

示例2: checkStatList

 private function checkStatList()
 {
     $this->tester->seeResponseCodeIs(200);
     $this->tester->seeResponseIsJson();
     $data = json_decode($this->tester->grabResponse(), true);
     $this->tester->seeResponseJsonMatchesJsonPath('$.status');
     $this->tester->seeResponseJsonMatchesJsonPath('$.data');
     foreach ($data['data']['stats'] as $item) {
         $this->assertArrayHasKey('team', $item);
         $this->assertArrayHasKey('player', $item);
         $this->assertArrayHasKey('id', $item['player']);
         $this->assertArrayHasKey('alias', $item['player']);
         $this->assertArrayHasKey('level', $item['player']);
         $this->assertArrayHasKey('isLive', $item['player']);
         $this->assertArrayHasKey('isLive', $item);
         $this->assertArrayHasKey('location', $item);
         $this->assertArrayHasKey('player', $item['location']);
         $this->assertArrayHasKey('lat', $item['location']);
         $this->assertArrayHasKey('lng', $item['location']);
         $this->assertArrayHasKey('game', $item['location']);
     }
 }
開發者ID:excrucio,項目名稱:RSC2015R-returnCaca,代碼行數:22,代碼來源:ApiStatsTest.php

示例3: checkLocationList

 private function checkLocationList()
 {
     $this->tester->seeResponseCodeIs(200);
     $this->tester->seeResponseIsJson();
     $this->tester->seeResponseJsonMatchesJsonPath('$.status');
     $this->tester->seeResponseJsonMatchesJsonPath('$.data');
     $this->tester->seeResponseJsonMatchesJsonPath('$.data[0].lat');
     $this->tester->seeResponseJsonMatchesJsonPath('$.data[0].lng');
     $this->tester->seeResponseJsonMatchesJsonPath('$.data[0].game');
 }
開發者ID:excrucio,項目名稱:RSC2015R-returnCaca,代碼行數:10,代碼來源:ApiLocationTest.php

示例4: ApiTester

<?php

Yii::$app->redis->executeCommand('FLUSHDB');
use Codeception\Util\Debug;
$model = new \app\models\Message();
$model->author_email = 'test@gmail.com';
$model->author_name = 'test';
$model->message = str_repeat('A', 140);
$model->save();
$I = new ApiTester($scenario);
$I->wantTo('Ver a lista de mensagens');
$I->sendGET('messages', []);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$[0].author_name');
$I->seeResponseJsonMatchesJsonPath('$[0].author_email');
$I->seeResponseJsonMatchesJsonPath('$[0].message');
$I->seeResponseJsonMatchesJsonPath('$[0].id');
$I->seeResponseJsonMatchesJsonPath('$[0].creation_time');
開發者ID:jsopra,項目名稱:lepetitmessager,代碼行數:18,代碼來源:ListCept.php

示例5: ApiTester

<?php

$I = new ApiTester($scenario);
$I->wantTo('log in as an anonymous user');
$I->sendPOST('users/login');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.skey');
$I->seeResponseJsonMatchesJsonPath('$.userid');
$I->seeResponseJsonMatchesJsonPath('$.email');
$guidResponse = $I->getRequestJSON();
$I->wantTo('log in as an anonymous user using a previous GUID');
$I->sendPOST('users/login', ['username' => $guidResponse['email']]);
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJSON(['email' => $guidResponse['email']]);
$I->seeResponseContainsJSON(['userid' => $guidResponse['userid']]);
$I->wantTo('fail to log in with an unregistered CCID');
$I->sendPOST('users/login', ['username' => '@12345678']);
$I->seeResponseCodeIs(401);
$I->wantTo('fail to log in with an incorrect CCID password');
$I->sendPOST('users/login', ['username' => 'rob@creativecommons.org', 'password' => 'obviouslybadpassword']);
$I->seeResponseCodeIs(401);
開發者ID:tom2320x,項目名稱:list,代碼行數:23,代碼來源:PostUsersLoginCept.php

示例6: ApiTester

<?php

$I = new ApiTester($scenario);
$I->wantTo('get a list of all cards');
$I->amHttpAuthenticated('test_api', '123456');
$I->haveHttpHeader('Content-Type', 'application/json');
$I->sendGET('/cards');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$[0].result');
開發者ID:NullDivision,項目名稱:tpl00001,代碼行數:10,代碼來源:GetCardsCept.php

示例7: ApiTester

<?php

$I = new ApiTester($scenario);
$I->wantTo('List vaults.');
$I->haveAuth();
$I->sendPUT('/-/vaults/testvault1');
$I->seeResponseCodeIs(201);
$I->sendPUT('/-/vaults/testvault2');
$I->seeResponseCodeIs(201);
$I->sendPUT('/-/vaults/testvault3');
$I->seeResponseCodeIs(201);
$I->sendGET('/-/vaults');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.VaultList');
$I->seeResponseJsonMatchesJsonPath('$.VaultList[*].VaultName');
$I->seeResponseJsonMatchesJsonPath('$.VaultList[*].CreationDate');
$I->seeResponseJsonMatchesJsonPath('$.VaultList[*].LastInventoryDate');
$I->seeResponseJsonMatchesJsonPath('$.VaultList[*].NumberOfArchives');
$I->seeResponseJsonMatchesJsonPath('$.VaultList[*].SizeInBytes');
$I->seeResponseJsonMatchesJsonPath('$.VaultList[*].VaultARN');
$I->sendDELETE('/-/vaults/testvault1');
$I->seeResponseCodeIs(204);
$I->sendDELETE('/-/vaults/testvault2');
$I->seeResponseCodeIs(204);
$I->sendDELETE('/-/vaults/testvault3');
$I->seeResponseCodeIs(204);
開發者ID:sebcode,項目名稱:gsandbox,代碼行數:27,代碼來源:ListVaultsCept.php

示例8: ApiTester

<?php

$I = new ApiTester($scenario);
$I->wantTo('validate that test route works properly');
$I->sendGET('/test');
$I->seeResponseIsJson();
$I->seeResponseJsonMatchesJsonPath('$.message');
開發者ID:joanlopez,項目名稱:php-generic-api,代碼行數:7,代碼來源:RouteTestCept.php

示例9: ApiTester

<?php

$I = new ApiTester($scenario);
$I->wantTo('list the most recent photos in the feed');
$I->sendGET('photos');
$I->seeResponseCodeIs(200);
//TODO: Check for reasonable values
$I->seeResponseJsonMatchesJsonPath('$.next_id');
$I->seeResponseJsonMatchesJsonPath('$.from_id');
$I->seeResponseJsonMatchesJsonPath('$.count');
//TODO: check for Creative Commons values
$I->seeResponseJsonMatchesJsonPath('$photos[*].itemid');
$I->seeResponseJsonMatchesJsonPath('$photos[*].url');
$I->seeResponseJsonMatchesJsonPath('$photos[*].title');
$I->seeResponseJsonMatchesJsonPath('$photos[*].description');
$I->seeResponseJsonMatchesJsonPath('$photos[*].category');
$I->seeResponseJsonMatchesJsonPath('$photos[*].approved');
$I->seeResponseJsonMatchesJsonPath('$photos[*].username');
$I->seeResponseJsonMatchesJsonPath('$photos[*].userid');
$I->seeResponseJsonMatchesJsonPath('$photos[*].makerid');
$I->seeResponseJsonMatchesJsonPath('$photos[*].makername');
開發者ID:tom2320x,項目名稱:list,代碼行數:21,代碼來源:GetFeedCept.php

示例10: ApiTester

<?php

$I = new ApiTester($scenario);
$I->wantTo('get the list of latest items from the master list');
$I->sendGET('items');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
//TODO: ensure count is 20
// The responses are random, so we cannot check specific id/title/etc. values
//TODO: check for Creative Commons values
$I->seeResponseJsonMatchesJsonPath('$[*].id');
$I->seeResponseJsonMatchesJsonPath('$[*].makerid');
$I->seeResponseJsonMatchesJsonPath('$[*].title');
$I->seeResponseJsonMatchesJsonPath('$[*].description');
$I->seeResponseJsonMatchesJsonPath('$[*].uri');
$I->seeResponseJsonMatchesJsonPath('$[*].approved');
$I->seeResponseJsonMatchesJsonPath('$[*].category');
$I->seeResponseJsonMatchesJsonPath('$[*].name');
開發者ID:tom2320x,項目名稱:list,代碼行數:18,代碼來源:GetItemsCept.php


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