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


PHP ApiTester::getActiveKeyholderMember方法代码示例

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


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

示例1: validDoorEntry

 public function validDoorEntry(ApiTester $I)
 {
     $I->am('a valid device');
     $I->wantTo('verify the endpoint returns a success door lookup response');
     $user = $I->getActiveKeyholderMember();
     $keyFob = $I->getMemberKeyFob($user->id);
     //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' => $keyFob->key_id, 'message' => 'lookup', 'service' => 'entry', 'time' => time()]);
     $I->canSeeResponseCodeIs(200);
     //Make sure a failure is returned
     $I->canSeeResponseContainsJson(['valid' => '1']);
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:14,代码来源:ACSCest.php

示例2: successfullMemberLogin

 public function successfullMemberLogin(ApiTester $I)
 {
     $I->am('an active member');
     $I->wantTo('post to the main door endpoint and get an OK back');
     $user = $I->getActiveKeyholderMember();
     $keyFob = $I->getMemberKeyFob($user->id);
     //Post the keyfob to the endpoint
     $I->sendPOST('/access-control/main-door', ['data' => $keyFob->key_id]);
     //The endpoint always returns 200
     $I->seeResponseCodeIs(200);
     //Make sure a good response is returned
     $I->seeResponseIsJson();
     //Response contains their name
     $I->seeResponseContains($user->given_name);
     //Make sure the request was allowed
     $I->seeResponseContainsJson(['valid' => '1']);
     $I->dontSeeHttpHeader('Set-Cookie');
     $I->dontSeeHttpHeader('Built-By');
     //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,代码行数:21,代码来源:AccessControlCest.php

示例3: successfullEnd

 public function successfullEnd(ApiTester $I)
 {
     $I->am('a valid user');
     $I->wantTo('verify the endpoint returns a success response and creates the proper records');
     $user = $I->getActiveKeyholderMember();
     $keyFob = $I->getMemberKeyFob($user->id);
     //Send a bad code to the endpoint
     $I->sendPOST('/access-control/device', ['data' => $keyFob->key_id . '|welder|start']);
     //The device endpoint always returns 200
     $I->canSeeResponseCodeIs(200);
     //Make sure a success is returned and a session started
     $I->canSeeResponseContainsJson(['valid' => '1']);
     $I->seeInDatabase('equipment_log', ['user_id' => $user->id, 'device' => 'welder', 'active' => 1]);
     $I->sendPOST('/access-control/device', ['data' => $keyFob->key_id . '|welder|end']);
     $I->canSeeResponseCodeIs(200);
     $I->dontSeeHttpHeader('Set-Cookie');
     $I->dontSeeHttpHeader('Built-By');
     $I->canSeeResponseContainsJson(['valid' => '1']);
     //Make sure our database record is not active
     $I->seeInDatabase('equipment_log', ['user_id' => $user->id, 'device' => 'welder', 'active' => 0]);
     //And make sure there is no other active record
     $I->cantSeeInDatabase('equipment_log', ['user_id' => $user->id, 'device' => 'welder', 'active' => 1]);
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:23,代码来源:DeviceAccessControlCest.php


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