#!/usr/local/cpanel/3rdparty/bin/perl

#                                      Copyright 2025 WebPros International, LLC
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited.

use cPstrict;
use Test::Cpanel::Policy;

use Test2::V0;
use Test2::Tools::Explain;
use Test2::Tools::Compare;
use Test2::Plugin::NoWarnings;

use Test::MockModule;
use Test::MockFile;

BEGIN {
    $INC{'Cpanel/HTTP/Client.pm'} = 1;
    $INC{'Cpanel/JSON.pm'} = 1;
    $INC{'Cpanel/Exception.pm'} = 1;
    $INC{'Cpanel/Logger.pm'} = 1;

    package Cpanel::HTTP::Client;
    sub new { return bless {}, shift; }

    package Cpanel::JSON;
    sub Load { return {}; }
    sub Dump { return shift; }

    package Cpanel::Exception;
    sub new { return bless {}, shift; }

    package Cpanel::Logger;
    sub new { return bless {}, shift; }
    sub info { }
    sub warn { }
    sub error { }
}

my @mock_files = (
    Test::MockFile->file('/var/cpanel/comet/server_credentials.json'),
);

use Whostmgr::CometBackup::CometBackupAPI ();

subtest 'CometBackupAPI - get_server_config method exists' => sub {
    ok( defined &Whostmgr::CometBackup::CometBackupAPI::get_server_config, 'get_server_config method exists' );
};

subtest 'CometBackupAPI - get_ua method exists' => sub {
    ok( defined &Whostmgr::CometBackup::CometBackupAPI::get_ua, 'get_ua method exists' );
};

subtest 'CometBackupAPI - get_user_profile_and_hash method exists' => sub {
    ok( defined &Whostmgr::CometBackup::CometBackupAPI::get_user_profile_and_hash, 'get_user_profile_and_hash method exists' );
};

subtest 'CometBackupAPI - get_destination_ids method exists' => sub {
    ok( defined &Whostmgr::CometBackup::CometBackupAPI::get_destination_ids, 'get_destination_ids method exists' );
};

subtest 'CometBackupAPI - get_device_id method exists' => sub {
    ok( defined &Whostmgr::CometBackup::CometBackupAPI::get_device_id, 'get_device_id method exists' );
};

subtest 'CometBackupAPI - make_server_request method exists' => sub {
    ok( defined &Whostmgr::CometBackup::CometBackupAPI::make_server_request, 'make_server_request method exists' );
};

done_testing();
