$server_id, "description" => "test $server_id", "type" => "server", "services" => "standard" ]); $api->serverServersPost("localhost", $server_command); $all_servers = $api->serverServersGet('localhost'); $has_serverId_id = array_filter($all_servers, function($b) { global $server_id; return $b->getServerId() == $server_id; }); assert(count($has_serverId_id) == 1); $saved_server = $api->serverServersServerIdGet('localhost', $server_id); assert(trim($saved_server->getDescription()) == trim($server_command->getDescription())); $to_update = new HelixWebServices\Model\ServerCommand([ "description" => "Update $rand" ]); $api->serverServersServerIdPatch('localhost', $server_id, $to_update); $updated = $api->serverServersServerIdGet('localhost', $server_id); assert(trim($updated->getDescription()) == trim($to_update->getDescription())); $api->serverServersServerIdDelete('localhost', $server_id); $all_servers2 = $api->serverServersGet('localhost'); if (!empty($all_servers2)) { $has_serverId_id2 = array_filter($all_servers2, function($b) { global $server_id; return $b->getServerId() == $server_id; }); assert(count($has_serverId_id2) == 0); }