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


PHP ApiTester类代码示例

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


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

示例1: deletePost

 public function deletePost(ApiTester $I)
 {
     $id = $I->haveRecord('posts', $this->getPostAttributes(['title' => 'Game of Thrones']));
     $I->sendDELETE($this->endpoint . "/{$id}");
     $I->seeResponseCodeIs(200);
     $I->dontSeeRecord('posts', ['id' => $id]);
 }
开发者ID:resulaslan,项目名称:sample-l4-app,代码行数:7,代码来源:PostsResourceCest.php

示例2: read

 /**
  * Preberem zapis
  * 
  * @param ApiTester $I
  * @depends create
  */
 public function read(\ApiTester $I)
 {
     $ent = $I->successfullyGet($this->restUrl, $this->obj['id']);
     $I->assertEquals($ent['sifra'], 'ZZ');
     $I->assertEquals($ent['naziv'], 'uu');
     $I->assertEquals($ent['opis'], 'zz');
 }
开发者ID:ifigenija,项目名称:server,代码行数:13,代码来源:ZvrstUprizoritveCest.php

示例3: getMeta

 /**
  * get meta
  * 
  * @param ApiTester $I
  */
 public function getMeta(\ApiTester $I)
 {
     $controller = "drzava";
     $view = "";
     $expected = "";
     $I->testFormMeta('drzava', '');
 }
开发者ID:ifigenija,项目名称:server,代码行数:12,代码来源:DrzavaCest.php

示例4: readDatum

 /**
  * Preberem zapis in preverim vsa polja
  * 
  * @depends create
  * @param ApiTester $I
  */
 public function readDatum(\ApiTester $I)
 {
     $ent = $I->successfullyGet($this->restUrl, $this->obj3['id']);
     codecept_debug($ent);
     $I->assertEquals($ent['zacetek'], '2009-09-14T00:00:00+0200');
     //konec spremenjen v +0200
     $ent = $I->successfullyGet($this->restUrl, $this->obj2['id']);
     $I->assertEquals($ent['zacetek'], '2003-02-01T00:00:00+0100');
 }
开发者ID:ifigenija,项目名称:server,代码行数:15,代码来源:TimeZoneCest.php

示例5: read

 /**
  * Preberem zapis in preverim vsa polja
  * 
  * @depends create
  * @param ApiTester $I
  */
 public function read(\ApiTester $I)
 {
     $ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
     $I->assertGuid($ent['id']);
     $I->assertEquals($ent['oznaka'], 'AA');
     $I->assertEquals($ent['naziv'], 'uu');
     $I->assertEquals($ent['aktiven'], TRUE);
     $I->assertEquals($ent['znacka'], TRUE);
     $I->assertEquals($ent['ikona'], 'AA');
 }
开发者ID:ifigenija,项目名称:server,代码行数:16,代码来源:VrstaZapisaCest.php

示例6: delete

 /**
  * @depends update
  */
 public function delete(ApiTester $I)
 {
     $I->wantTo('Delete a new Contact in com_contacts using DELETE');
     $I->amHttpAuthenticated('admin', 'admin');
     $I->sendDELETE('index.php' . '?option=contact' . '&api=Hal' . '&webserviceClient=administrator' . '&webserviceVersion=1.0.0' . "&id={$this->id}");
     $I->seeResponseCodeIs(200);
     $I->sendGET('index.php' . '?option=contact' . '&api=Hal' . '&webserviceClient=administrator' . '&webserviceVersion=1.0.0' . "&id={$this->id}");
     $I->seeResponseCodeIs(404);
     $I->seeResponseIsJson();
     $I->seeResponseContains('"message":"Item not found with given key.","code":404,"type":"Exception"');
 }
开发者ID:thangredweb,项目名称:redCORE,代码行数:14,代码来源:administrator.contact.1.0.0.Cest.php

示例7: deleteUser

 public function deleteUser(ApiTester $I, \Codeception\Scenario $scenario)
 {
     //$scenario->skip('ownCloud master is broken');
     $I->wantTo('delete the user');
     $I->amHttpAuthenticated('admin', 'admin');
     $I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded');
     $I->sendDELETE($this->apiUrl . '/users/' . $this->userId);
     $I->seeResponseCodeIs(200);
     $I->seeResponseIsXml();
     $I->seeXmlResponseIncludes(XmlUtils::toXml(['status' => 'ok']));
 }
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:11,代码来源:OcsCreateUserCest.php

示例8: read

 /**
  * Preberem abonma
  * 
  * @param ApiTester $I
  * @depends create
  */
 public function read(\ApiTester $I)
 {
     $ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
     codecept_debug($ent);
     $I->assertEquals($ent['stPredstav'], 5);
     $I->assertEquals($ent['stKuponov'], 55);
     $I->assertEquals($ent['ime'], 'zz');
     $I->assertEquals($ent['opis'], 'zz');
     $I->assertEquals($ent['kapaciteta'], 444);
     $I->assertEquals($ent['barva'], '#123456');
 }
开发者ID:ifigenija,项目名称:server,代码行数:17,代码来源:AbonmaCest.php

示例9: delete

 public function delete(ApiTester $I)
 {
     $I->wantTo('delete 1 contact in Joomla using SOAP');
     $I->amHttpAuthenticated('admin', 'admin');
     $I->sendSoapRequest('delete', ['id' => $this->id]);
     $I->seeSoapResponseIncludes("<result>true</result>");
     $I->sendSoapRequest('readItem', ['id' => $this->id]);
     $I->dontSeeSoapResponseIncludes("<name>{$this->name}</name>");
 }
开发者ID:thangredweb,项目名称:redCORE,代码行数:9,代码来源:administrator.contact.1.0.0.soap.Cest.php

示例10: deleteDiscussion

 public function deleteDiscussion(ApiTester $I)
 {
     $I->wantTo('delete a discussion via API');
     $user = $I->amAuthenticated();
     $user->groups()->attach(4);
     // Make the user a moderator
     $discussion = Factory::create('Flarum\\Core\\Models\\Discussion', ['start_user_id' => $user->id]);
     $I->sendDELETE($this->endpoint . '/' . $discussion->id);
     $I->seeResponseCodeIs(204);
     $I->seeResponseEquals('');
     $I->expect('the discussion was deleted in the database');
     $I->dontSeeRecord('discussions', ['id' => $discussion->id]);
 }
开发者ID:Qiang1234,项目名称:core,代码行数:13,代码来源:DiscussionsResourceCest.php

示例11: unknownDeviceSystemMessage

 public function unknownDeviceSystemMessage(ApiTester $I)
 {
     $I->am('sending a valid system message');
     $I->wantTo('confirm it is received and handled correctly');
     //Post the keyfob to the endpoint
     $I->sendPOST('/access-control/main-door', ['data' => ':unknown|unknown']);
     //The endpoint always returns 200
     $I->seeResponseCodeIs(200);
     //Confirm an access log record was created
     //$I->seeInDatabase('access_log', ['user_id'=>$user->id, 'key_fob_id'=>$keyFob->id, 'response'=>200, 'service'=>'main-door']);
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:11,代码来源:AccessControlCest.php

示例12: invalidTime

 public function invalidTime(ApiTester $I)
 {
     $I->am('an invalid device');
     $I->wantTo('verify the endpoint returns validation failures - invalid time');
     //Send a bad code to the endpoint
     $I->haveHttpHeader('Content-Type', 'application/json');
     $I->haveHttpHeader('Accept', 'application/json');
     $I->sendPOST('/acs', ['device' => 'main-door', 'tag' => 'ABCDEF123456', 'message' => 'boot', 'service' => 'entry', 'time' => 'abcdefgh']);
     $I->canSeeResponseCodeIs(422);
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:10,代码来源:ACSCest.php

示例13: read

 /**
  * Preberem zapis in preverim vsa polja
  * 
  * @depends create
  * @param ApiTester $I
  */
 public function read(\ApiTester $I)
 {
     $ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
     codecept_debug($ent);
     $I->assertGuid($ent['id']);
     $I->assertEquals($ent['name'], 'TESTA');
     $I->assertEquals($ent['description'], 'to je A');
     $I->assertEquals($ent['builtIn'], false);
     //sam določi
 }
开发者ID:ifigenija,项目名称:server,代码行数:16,代码来源:PermissionCest.php

示例14: read

 /**
  * Preberem zapis in preverim vsa polja
  * 
  * @depends create
  * @param ApiTester $I
  */
 public function read(\ApiTester $I)
 {
     $ent = $I->successfullyGet($this->restUrl, $this->obj1['id']);
     $I->assertNotEmpty($ent['id']);
     $I->assertEquals($ent['uprizoritev']['id'], $this->lookUprizoritev['id']);
     $I->assertEquals($ent['krajGostovanja'], 'zz');
     $I->assertEquals($ent['drzavaGostovanja'], $this->objDrzava1['id']);
     $I->assertEquals($ent['ustanova'], 'zz');
     $I->assertEquals($ent['datumGostovanja'], '2011-02-01T00:00:00+0100');
     $I->assertEquals($ent['ponoviInt'], 9);
     $I->assertEquals($ent['ponoviKoprInt'], 9);
     $I->assertEquals($ent['obiskInt'], 9);
     $I->assertEquals($ent['obiskKoprInt'], 9);
     $I->assertEquals($ent['zaproseno'], 9.119999999999999, "izračunano zaprošeno");
     $I->assertEquals($ent['celotnaVrednost'], 45.6);
     $I->assertEquals($ent['nasDelez'], 45.6);
     $I->assertEquals($ent['transportniStroski'], 9.119999999999999);
     $I->assertEquals($ent['dnevPrvZad'], 9.119999999999999);
     $I->assertEquals($ent['tantieme'], 9.119999999999999);
     $I->assertEquals($ent['materialni'], 9.119999999999999);
     $I->assertEquals($ent['avtorskePravice'], 0);
     $I->assertEquals($ent['avtorskiHonorarji'], 9.119999999999999);
     $I->assertEquals($ent['avtorskiHonorarjiSamoz'], 9.119999999999999);
     $I->assertEquals($ent['vlozekGostitelja'], 2.34);
     $I->assertEquals($ent['lastnaSredstva'], $ent['nasDelez'] - $ent['zaproseno'] - $ent['drugiJavni'] - $ent['vlozekGostitelja'], "lastna sredstva");
     $I->assertEquals($ent['celotnaVrednostMat'], 0);
     //        $I->assertEquals($ent['drugiViri'], 9.12);
     $I->assertEquals($ent['drugiJavni'], 9.119999999999999);
     $I->assertEquals($ent['dokument'], NULL);
     $I->assertEquals($ent['gostitelj']['id'], $this->lookPopa1['id']);
     $I->assertEquals($ent['sort'], 1);
     $I->assertEquals($ent['imaKoprodukcije'], TRUE);
 }
开发者ID:ifigenija,项目名称:server,代码行数:39,代码来源:ProgramGostovanjeCest.php

示例15: ApiTester

<?php

include 'version.php';
$I = new ApiTester($scenario);
$I->wantTo('fetch the version information for the web app');
$I->sendGET('version');
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
$I->seeResponseContainsJson(["api_version" => $api_version, "app_version" => $app_version, "webapp_version" => $webapp_version]);
开发者ID:tom2320x,项目名称:list,代码行数:9,代码来源:GetVersionCept.php


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