$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);