<?php set_include_path(__DIR__.'/../../HelixWebServices/lib'); // thj: I have no idea if there's a better way of doing this in PHP. include 'ApiClient.php'; include 'ApiException.php'; include 'Configuration.php'; include 'ObjectSerializer.php'; include 'Api/AlphaApi.php'; include 'Api/DefaultApi.php'; include 'Model/BranchCommand.php'; include 'Model/BranchesCommand.php'; include 'Model/ChangeCommand.php'; include 'Model/ChangelistAction.php'; include 'Model/ChangelistRequest.php'; include 'Model/ChangesCommand.php'; include 'Model/ClientCommand.php'; include 'Model/ClientsCommand.php'; include 'Model/CommandRequest.php'; include 'Model/CommandResponse.php'; include 'Model/Counter.php'; include 'Model/DepotCommand.php'; include 'Model/DepotsCommand.php'; include 'Model/DirsCommand.php'; include 'Model/FilesCommand.php'; include 'Model/FstatCommand.php'; include 'Model/GitFusionRepoBranchConfig.php'; include 'Model/GitFusionRepoConfig.php'; include 'Model/GitFusionRepoGlobalOverrides.php'; include 'Model/GitFusionRepoId.php'; include 'Model/GroupCommand.php'; include 'Model/GroupsCommand.php'; include 'Model/HWSStatus.php'; include 'Model/JobCommand.php'; include 'Model/JobsCommand.php'; include 'Model/LabelCommand.php'; include 'Model/LabelsCommand.php'; include 'Model/Location.php'; include 'Model/LoginRequest.php'; include 'Model/LoginResponse.php'; include 'Model/P4dConfigId.php'; include 'Model/Protections.php'; include 'Model/ServerCommand.php'; include 'Model/ServerLoginRequest.php'; include 'Model/ServersCommand.php'; include 'Model/StreamCommand.php'; include 'Model/StreamsCommand.php'; include 'Model/Triggers.php'; include 'Model/UserCommand.php'; include 'Model/UsersCommand.php'; use HelixWebServices\Api\DefaultApi; function apiNoAuth() { $api = new DefaultApi(); $api->getApiClient()->getConfig()->setHost("http://localhost:9000/api"); return $api; } function apiAsJDoe() { $api = apiNoAuth(); $login_request = new HelixWebServices\Model\LoginRequest(); $login_request->setUser("jdoe"); $login_request->setPassword("johndoe1A!"); $login_response = $api->loginPost($login_request); $api->getApiClient()->getConfig()->setApiKey("Authorization", $login_response->getTicket()); return $api; } function apiAsSuper() { $api = apiNoAuth(); $login_request = new HelixWebServices\Model\LoginRequest(); $login_request->setUser("super"); $login_request->setPassword("superuser1A!"); $login_response = $api->loginPost($login_request); $api->getApiClient()->getConfig()->setApiKey("Authorization", $login_response->getTicket()); return $api; } // PHP 5.3 Anonymous function as callback // code is untested assert_options(ASSERT_CALLBACK, function($file, $line, $code) { throw new Exception('Assert failed in $file on line $line'); });
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 19597 | swellard | Refactor REST path | ||
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/php/tests/util/test_config.php | |||||
#2 | 19237 | tjuricek |
Branch specs test for PHP Client SDK The default template didn't check isset(), so added that to the constructor initialization on models. |
||
#1 | 19205 | tjuricek | Basic infrastructure for PHP testing, and, removing the ps check after startup - seems to be too fast, though the server should be already responding to p4 info commands. |