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

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

package t::Cpanel::Config::ConfigObj::Driver::ServerMonitoring;

use cPstrict;

use Test::More tests => 7 + 1;    # +1NoWarnings  # +1logger

use Test::Cpanel::Policy;

use Test::NoWarnings;

use parent qw(
  Cpanel::TestObj
);

use Cpanel::Config::ConfigObj                           ();
use Cpanel::Config::ConfigObj::Driver::ServerMonitoring ();

my $so  = Cpanel::Config::ConfigObj->new();
my $obj = Cpanel::Config::ConfigObj::Driver::ServerMonitoring->init($so);

isa_ok( $obj, 'Cpanel::Config::ConfigObj::Driver::ServerMonitoring' );
isa_ok( $obj, 'Cpanel::Config::ConfigObj::Interface::Config::v1' );
isa_ok( $obj, 'Cpanel::Config::ConfigObj::Interface::Whostmgr' );

is( $obj->enable(),  1, "enable returns 1" );
is( $obj->disable(), 0, "disable returns 0" );
is( $obj->check(),   1, "check returns 1" );
like(
    $obj->info(),
    qr/cPanel & WHM now provides the Server Monitoring feature. You can use Server Monitoring to track your server's performance and up-time statistics./,
    "info is correct"
);

1;
