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


PHP ApiTester::createProjectAndSetHeader方法代码示例

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


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

示例1: variantsProbabilityInvalid

 public function variantsProbabilityInvalid(ApiTester $I)
 {
     $I->createAndLoginUser();
     $I->createProjectAndSetHeader();
     # invalid variants_probability
     $data = $I->getTableShortData();
     $data['variants_probability'] = 'invalid';
     $I->sendPOST('api/v1/admin/tables', $data);
     $I->seeResponseCodeIs(422);
     $I->seeResponseContains('variants_probability');
     # more than 100
     $data['variants_probability'] = 'percent';
     $data['variants'][0]['probability'] = 30;
     $data['variants'][0]['title'] = 'Variant 1';
     $data['variants'][1] = ['title' => 'Variant 2', 'default_title' => 'Variant 2', 'default_description' => 'Description Variant 2', 'default_decision' => 'Decline', 'probability' => 71, 'rules' => $I->getVariantRules()];
     $I->sendPOST('api/v1/admin/tables', $data);
     $I->seeResponseCodeIs(422);
     $I->seeResponseContains('variants_probability');
     # less than 100
     $data['variants'][0]['probability'] = 28;
     $I->sendPOST('api/v1/admin/tables', $data);
     $I->seeResponseCodeIs(422);
     $I->seeResponseContains('variants_probability');
 }
开发者ID:Nebo15,项目名称:gandalf.api,代码行数:24,代码来源:TablesCest.php

示例2: canNotEditItself

 public function canNotEditItself(ApiTester $I)
 {
     $user = $I->createAndLoginUser();
     $I->createProjectAndSetHeader();
     $I->sendPUT('api/v1/projects/users', ['user_id' => $user->_id, 'role' => 'manager', 'scope' => ['tables_view', 'tables_update', 'users_manage']]);
     $I->seeResponseCodeIs(403);
     $I->loginClient($I->getCurrentClient());
     $second_user = $I->createUser(true);
     $I->loginUser($user);
     $I->sendPOST('api/v1/projects/users', ['user_id' => $second_user->_id, 'role' => 'manager', 'scope' => ['tables_view', 'tables_update', 'users_manage']]);
     $I->seeResponseCodeIs(201);
     $I->loginUser($second_user);
     $I->sendPUT('api/v1/projects/users', ['user_id' => $user->_id, 'role' => 'manager', 'scope' => ['tables_view', 'tables_update', 'users_manage']]);
     $I->seeResponseCodeIs(403);
     $I->loginUser($user);
     $I->sendPOST('api/v1/projects/users/admin', ['user_id' => $second_user->_id]);
     $I->seeResponseCodeIs(200);
     $I->loginUser($second_user);
     $I->sendPUT('api/v1/projects/users', ['user_id' => $user->_id, 'role' => 'manager', 'scope' => ['tables_view', 'tables_update', 'users_manage']]);
     $I->seeResponseCodeIs(200);
 }
开发者ID:Nebo15,项目名称:gandalf.api,代码行数:21,代码来源:UsersCest.php

示例3: getCurrentUserScope

 public function getCurrentUserScope(ApiTester $I)
 {
     $user = $I->createAndLoginUser();
     $I->createProjectAndSetHeader();
     $I->loginClient($I->getCurrentClient());
     $second_user = $I->createUser(true);
     $I->loginUser($user);
     $I->sendPOST('api/v1/projects/users', ['user_id' => $second_user->_id, 'role' => 'manager', 'scope' => ['tables_view', 'tables_update']]);
     $I->loginUser($second_user);
     $I->sendGET('api/v1/projects/users');
     $I->assertProjectUser();
 }
开发者ID:Nebo15,项目名称:gandalf.api,代码行数:12,代码来源:ProjectsCest.php

示例4: hideMeta

 public function hideMeta(ApiTester $I)
 {
     $I->createAndLoginUser();
     $I->createProjectAndSetHeader(['settings' => ['show_meta' => false]]);
     $I->createTable();
     $I->makeDecision($I->getResponseFields()->data->_id, [], 'decision', false);
 }
开发者ID:Nebo15,项目名称:gandalf.api,代码行数:7,代码来源:DecisionsCest.php


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