本文整理汇总了PHP中ApiTester::seeHttpHeader方法的典型用法代码示例。如果您正苦于以下问题:PHP ApiTester::seeHttpHeader方法的具体用法?PHP ApiTester::seeHttpHeader怎么用?PHP ApiTester::seeHttpHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiTester
的用法示例。
在下文中一共展示了ApiTester::seeHttpHeader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: WebserviceIsAvailable
public function WebserviceIsAvailable(ApiTester $I)
{
$I->wantTo("check the availability of the webservice");
$I->amHttpAuthenticated('admin', 'admin');
$I->sendGET('index.php' . '?option=contact' . '&api=Hal' . '&webserviceClient=administrator' . '&webserviceVersion=1.0.0');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeHttpHeader('Webservice-name', 'contact');
$I->seeHttpHeader('Webservice-version', '1.0.0');
}
示例2: ApiTester
<?php
$I = new ApiTester($scenario);
$I->wantTo('create a new device');
$user = $I->haveAnAccount();
$I->amHttpAuthenticated($user['email'], $user['password']);
$I->sendPOST('devices', ['mac' => '00:19:20:A1:B4:FC', 'name' => 'Manuel']);
$I->seeResponseCodeIs(422);
$I->seeResponseIsJson();
$I->sendPOST('devices', ['ip' => '192.168.1.123', 'mac' => '00:19:20:A1:B4:FC', 'name' => 'Manuel']);
$I->seeResponseCodeIs(201);
$I->seeHttpHeader('Location', 'http://localhost/api/v1/devices/1');
$I->seeResponseIsJson();
$I->seeResponseContainsJson(['data' => ['ip' => '192.168.1.123', 'name' => 'Manuel', 'on_home_page' => 'auto', 'group' => null]]);
$I->seeResponseJsonMatchesXpath('//data//device_added');
$I->seeResponseJsonMatchesXpath('//data//last_contact');
$I->seeRecord('devices', ['ip' => '192.168.1.123', 'mac' => '00:19:20:A1:B4:FC', 'name' => 'Manuel', 'public' => 'auto', 'group' => null]);
示例3: ApiTester
<?php
$I = new ApiTester($scenario);
$I->wantTo('get json via database/scheme');
$I->haveHttpHeader('X-PublicKey', '248512b6a66f365a4e42f10ed0c854844767b8ca8eb0f74589953991e9f233b6');
$I->haveHttpHeader('X-Hash', 'e651e0f6450f89d82ab0a34c1d421097a635897f5e719179e49263ff145e6ed9');
$I->sendGET('database/scheme');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeHttpHeader('Content-Type', 'application/json;charset=utf-8');
// we check not every field, just assets, location and facilities.
//automatic counter for array index
$i = -1;
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'AssetID', 'Type' => 'char(13)', 'Null' => 'NO', 'Key' => 'PRI', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'GenericAssetID', 'Type' => 'int(10)', 'Null' => 'YES', 'Key' => 'MUL', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'UMDNS', 'Type' => 'int(10)', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'AssetFullName', 'Type' => 'varchar(255)', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'ManufacturerID', 'Type' => 'char(13)', 'Null' => 'YES', 'Key' => 'MUL', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'Model', 'Type' => 'varchar(255)', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'SerialNumber', 'Type' => 'varchar(255)', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'InternalIventoryNumber', 'Type' => 'varchar(255)', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'LocationID', 'Type' => 'char(13)', 'Null' => 'YES', 'Key' => 'MUL', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'ResponsiblePers', 'Type' => 'varchar(50)', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'AssetStatusID', 'Type' => 'int(10)', 'Null' => 'YES', 'Key' => 'MUL', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'AssetUtilizationID', 'Type' => 'int(10)', 'Null' => 'YES', 'Key' => 'MUL', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'PurchaseDate', 'Type' => 'date', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'InstallationDate', 'Type' => 'date', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'Lifetime', 'Type' => 'int(11)', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'PurchasePrice', 'Type' => 'double(24,0)', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'CurrentValue', 'Type' => 'double(24,0)', 'Null' => 'YES', 'Key' => '', 'Default' => NULL, 'Extra' => ''))));
$I->seeResponseContainsJson(array('assets' => array(++$i => array('Field' => 'WarrantyContractID', 'Type' => 'int(10)', 'Null' => 'YES', 'Key' => 'MUL', 'Default' => NULL, 'Extra' => ''))));