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

#                                      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.

package t::medium::Cpanel::Config::ConfigObj::Driver::Xovi;

use cPstrict;

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

use Test::Cpanel::Policy;

use Test::NoWarnings;

use parent qw(
  Cpanel::TestObj
);

use File::Temp;
use Test::Cpanel::Mocker;

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

my $localopts_path = File::Temp::tempdir( CLEANUP => 1 ) . '/file';
do { open my $fh, '>', $localopts_path };

my @mm = Test::Cpanel::Mocker::mock_subs(
    'Cpanel::Config::LoadConfig::load_from_cache_if_valid' => sub { },
    'Cpanel::SafeFile::_verbose_flag_file_exists'          => 0,
);

local $Cpanel::Config::ConfigObj::Driver::XOVI::_LOCALOPTS_PATH = $localopts_path;

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

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

my @spec_methods = sort keys %{ Cpanel::Config::ConfigObj::Interface::Config::v1::spec_actions() };
foreach (@spec_methods) {
    my $has_method = ( $obj->can($_) ) ? 1 : 0;
    is( $has_method, 1, "showcase entry implements v1 spec method '$_'" );
}

1;
