#!/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;

BEGIN {
    $INC{'Cpanel/AppConfig.pm'}                            = 1;
    $INC{'Cpanel/TaskQueue/Reader.pm'}                     = 1;
    $INC{'Cpanel/Exception.pm'}                            = 1;
    $INC{'Cpanel/Plugins/Components/Rules.pm'}             = 1;
    $INC{'Cpanel/Plugins/Components/Rules/Util/NVData.pm'} = 1;
    $INC{'Cpanel/Plugins/Components/Rules/CompanyId.pm'}   = 1;
    $INC{'Cpanel/PwCache.pm'}                              = 1;
    $INC{'Whostmgr/ACLS.pm'}                               = 1;
    $INC{'POSIX.pm'}                                       = 1;
    $INC{'Cpanel/Imports.pm'}                              = 1;
    $INC{'Cpanel/Logger.pm'}                               = 1;

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

    package Cpanel::TaskQueue::Reader;
    sub read_queue { return { waiting_queue => [], processing_queue => [] }; }

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

    package Cpanel::Plugins::Components::Rules;
    sub new { return bless {}, shift; }

    package Cpanel::Plugins::Components::Rules::Util::NVData;
    sub new { return bless {}, shift; }

    package Cpanel::Plugins::Components::Rules::CompanyId;
    sub new { return bless {}, shift; }

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

    package Whostmgr::ACLS;
    sub new { return bless {}, shift; }

    package POSIX;
    sub new { return bless {}, shift; }

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

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

use Whostmgr::CometBackup::Setup ();

subtest 'Setup - is_setup function exists' => sub {
    ok( defined &Whostmgr::CometBackup::Setup::is_setup, 'is_setup function exists' );
};

done_testing();
