$job_id, "User" => 'jdoe', "Description" => "test $job_id", "Status" => 'open' ]); $api->serverJobsPost("localhost", $job_command); $all_jobs = $api->serverJobsGet('localhost'); $has_job_id = array_filter($all_jobs, function($b) { global $job_id; return $b['Job'] == $job_id; }); assert(count($has_job_id) == 1); $saved_job = $api->serverJobsJobGet('localhost', $job_id); assert(trim($saved_job['Description']) == trim($job_command['Description'])); assert($saved_job['User'] == $job_command['User']); assert($saved_job['Status'] == $job_command['Status']); $to_update = new HelixWebServices\Model\JobCommand([ "Status" => 'closed' ]); $api->serverJobsJobPatch('localhost', $job_id, $to_update); $updated = $api->serverJobsJobGet('localhost', $job_id); assert($updated['Status'] == 'closed'); $api->serverJobsJobDelete('localhost', $job_id); $all_jobs2 = $api->serverJobsGet('localhost'); if (!empty($all_jobs2)) { $has_job_id2 = array_filter($all_jobs2, function($b) { global $job_id; return $b['Job'] == $job_id; }); assert(count($has_job_id2) == 0); }