<?php include 'util/test_config.php'; include 'util/string_utils.php'; $api = apiAsJDoe(); $rand = generateRandomString(); $branch_id = "test-branch-$rand"; $branch_command = new HelixWebServices\Model\BranchCommand([ "branch" => $branch_id, "view" => [ "//depot/main/$branch_id/... //depot/dev/$branch_id/..." ] ]); $api->serverBranchesPost("localhost", $branch_command); $all_branches = $api->serverBranchesGet('localhost'); $has_branch_id = array_filter($all_branches, function($b) { global $branch_id; return $b->getBranch() == $branch_id; }); assert(count($has_branch_id) == 1); $saved_branch = $api->serverBranchesBranchGet('localhost', $branch_id); assert($saved_branch->getView() == $branch_command->getView(), "view was not saved"); $to_update = new HelixWebServices\Model\BranchCommand([ "description" => "Update $rand" ]); $api->serverBranchesBranchPatch('localhost', $branch_id, $to_update); $updated = $api->serverBranchesBranchGet('localhost', $branch_id); assert(trim($updated->getDescription()) == trim($to_update->getDescription())); $api->serverBranchesBranchDelete('localhost', $branch_id); $all_branches2 = $api->serverBranchesGet('localhost'); $has_branch_id2 = array_filter($all_branches2, function($b) { global $branch_id; return $b->getBranch() == $branch_id; }); assert(count($has_branch_id2) == 0);
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/php/tests/default_api.server_branches.crud.php | |||||
#2 | 19242 | tjuricek |
Change, client, command tests for PHP Client SDK. Changed how array-like query parameters were passed to the server to be consistent with other SDKs. |
||
#1 | 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. |