Bug 33733: Remove need for Test::DBIx::Class
Test plan: Run t/XSLT.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
b28d329d8a
commit
42e96a8622
1 changed files with 6 additions and 17 deletions
23
t/XSLT.t
23
t/XSLT.t
|
@ -16,33 +16,22 @@
|
||||||
# along with Koha; if not, see <http://www.gnu.org/licenses>.
|
# along with Koha; if not, see <http://www.gnu.org/licenses>.
|
||||||
|
|
||||||
use Modern::Perl;
|
use Modern::Perl;
|
||||||
use Test::More;
|
use Test::More tests => 1;
|
||||||
|
|
||||||
use File::Temp;
|
use File::Temp;
|
||||||
use File::Path qw/make_path/;
|
use File::Path qw/make_path/;
|
||||||
|
|
||||||
use t::lib::Mocks;
|
use t::lib::Mocks;
|
||||||
|
|
||||||
use Module::Load::Conditional qw/check_install/;
|
use C4::XSLT;
|
||||||
|
|
||||||
BEGIN {
|
|
||||||
if ( check_install( module => 'Test::DBIx::Class' ) ) {
|
|
||||||
plan tests => 9;
|
|
||||||
} else {
|
|
||||||
plan skip_all => "Need Test::DBIx::Class"
|
|
||||||
}
|
|
||||||
|
|
||||||
use_ok('C4::XSLT');
|
|
||||||
};
|
|
||||||
|
|
||||||
use Test::DBIx::Class;
|
|
||||||
my $db = Test::MockModule->new('Koha::Database');
|
|
||||||
$db->mock( _new_schema => sub { return Schema(); } );
|
|
||||||
|
|
||||||
my $dir = File::Temp->newdir();
|
my $dir = File::Temp->newdir();
|
||||||
my @themes = ('prog', 'test');
|
my @themes = ('prog', 'test');
|
||||||
my @langs = ('en', 'es-ES');
|
my @langs = ('en', 'es-ES');
|
||||||
|
|
||||||
|
subtest 'Tests moved from t' => sub {
|
||||||
|
plan tests => 8;
|
||||||
|
|
||||||
# create temporary files to be tested later
|
# create temporary files to be tested later
|
||||||
foreach my $theme (@themes) {
|
foreach my $theme (@themes) {
|
||||||
foreach my $lang (@langs) {
|
foreach my $lang (@langs) {
|
||||||
|
@ -76,4 +65,4 @@ is(find_and_slurp($dir, 'nope', 'fr-FR'), 'Theme prog, language en', 'Fell ba
|
||||||
my $matching_string = q{<syspref name="singleBranchMode">0</syspref>};
|
my $matching_string = q{<syspref name="singleBranchMode">0</syspref>};
|
||||||
my $sysprefs_xml = C4::XSLT::get_xslt_sysprefs();
|
my $sysprefs_xml = C4::XSLT::get_xslt_sysprefs();
|
||||||
ok( $sysprefs_xml =~ m/$matching_string/, 'singleBranchMode has a value of 0');
|
ok( $sysprefs_xml =~ m/$matching_string/, 'singleBranchMode has a value of 0');
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue