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


PHP ApiTester::seeHttpHeader方法代碼示例

本文整理匯總了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');
 }
開發者ID:thangredweb,項目名稱:redCORE,代碼行數:10,代碼來源:administrator.contact.1.0.0.Cest.php

示例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]);
開發者ID:4mb,項目名稱:pi.strebl.ch,代碼行數:17,代碼來源:CreateDeviceCept.php

示例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' => ''))));
開發者ID:Rudianasaja,項目名稱:openMEDIS-Slim-PHP-REST-API,代碼行數:31,代碼來源:DatabaseSchemeCept.php


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