當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。