当前位置: 首页>>代码示例>>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;未经允许,请勿转载。