use Modern::Perl;
-use Test::More tests => 46;
+use Test::More;
use Test::MockModule;
use Test::Warn;
+use Module::Load::Conditional qw/check_install/;
+
BEGIN {
- use_ok('C4::Biblio');
+ if ( check_install( module => 'Test::DBIx::Class' ) ) {
+ plan tests => 46;
+ } else {
+ plan skip_all => "Need Test::DBIx::Class"
+ }
}
+use_ok('C4::Biblio');
+
use Test::DBIx::Class {
schema_class => 'Koha::Schema',
connect_info => ['dbi:SQLite:dbname=:memory:','',''],
-#!/usr/bin/env perl
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
+
+use Test::More;
+use Test::MockModule;
+
use DateTime;
use DateTime::Duration;
-use Test::More tests => 35;
-use Test::MockModule;
use Koha::Cache;
use Koha::DateUtils;
-BEGIN {
- use_ok('Koha::Calendar');
+use Module::Load::Conditional qw/check_install/;
- # This was the only test C4 had
- # Remove when no longer used
- #use_ok('C4::Calendar'); # not used anymore?
+BEGIN {
+ if ( check_install( module => 'Test::DBIx::Class' ) ) {
+ plan tests => 35;
+ } else {
+ plan skip_all => "Need Test::DBIx::Class"
+ }
}
+
+use_ok('Koha::Calendar');
+
use Test::DBIx::Class {
schema_class => 'Koha::Schema',
connect_info => ['dbi:SQLite:dbname=:memory:','',''],
'==', 40, 'Test parameter order not relevant (Days)' );
}
+
+1;
#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
-#Testing C4 Images
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
-use Test::More tests => 8;
+
+use Test::More;
use Test::MockModule;
+use Module::Load::Conditional qw/check_install/;
+
+BEGIN {
+ if ( check_install( module => 'Test::DBIx::Class' ) ) {
+ plan tests => 8;
+ } else {
+ plan skip_all => "Need Test::DBIx::Class"
+ }
+}
+
use_ok('C4::Images');
use Test::DBIx::Class {
is( $imagenumbers[1], 3, 'imagenumber is 3' );
is( $imagenumbers[4], undef, 'imagenumber undef' );
+
+1;
#!/usr/bin/perl
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
+
use Modern::Perl;
-use Test::More tests => 25;
+
+use Test::More;
use t::lib::Mocks;
+use Module::Load::Conditional qw/check_install/;
+
+BEGIN {
+ if ( check_install( module => 'Test::DBIx::Class' ) ) {
+ plan tests => 25;
+ } else {
+ plan skip_all => "Need Test::DBIx::Class"
+ }
+}
+
use_ok('C4::ItemType');
use Test::DBIx::Class {
$itemtype = C4::ItemType->get;
is( $itemtype, undef, 'C4::ItemType->get should return unless if no parameter is given' );
+
+1;
use Modern::Perl;
use C4::Context;
-use Test::More tests => 30;
+use Test::More;
use Test::MockModule;
+use Module::Load::Conditional qw/check_install/;
+
+BEGIN {
+ if ( check_install( module => 'Test::DBIx::Class' ) ) {
+ plan tests => 30;
+ } else {
+ plan skip_all => "Need Test::DBIx::Class"
+ }
+}
+
use_ok('C4::Koha');
use Test::DBIx::Class {
use Modern::Perl;
-use DBI;
use Test::MockModule;
-use Test::More tests => 6;
+use Test::More;
+
+use Module::Load::Conditional qw/check_install/;
+
+BEGIN {
+ if ( check_install( module => 'Test::DBIx::Class' ) ) {
+ plan tests => 6;
+ } else {
+ plan skip_all => "Need Test::DBIx::Class"
+ }
+}
use Test::DBIx::Class {
schema_class => 'Koha::Schema',
#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
-#testing C4 matcher
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
+
+use Modern::Perl;
-use strict;
-use warnings;
-use Test::More tests => 11;
+use Test::More;
use Test::MockModule;
+use Module::Load::Conditional qw/check_install/;
+
BEGIN {
- use_ok('C4::Matcher');
+ if ( check_install( module => 'Test::DBIx::Class' ) ) {
+ plan tests => 11;
+ } else {
+ plan skip_all => "Need Test::DBIx::Class"
+ }
}
+use_ok('C4::Matcher');
+
use Test::DBIx::Class {
schema_class => 'Koha::Schema',
connect_info => ['dbi:SQLite:dbname=:memory:','',''],
$testmatcher->description('match on ISSN');
is( $testmatcher->description(), 'match on ISSN', 'testing code accessor' );
+
+1;
#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Tests 'fetch', 'fake db data', and 'checks for existant attributes'
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
+
use Test::MockModule;
-use Test::More tests => 10;
+use Test::More;
+
+use Module::Load::Conditional qw/check_install/;
BEGIN {
- use_ok('C4::Members::AttributeTypes');
+ if ( check_install( module => 'Test::DBIx::Class' ) ) {
+ plan tests => 10;
+ } else {
+ plan skip_all => "Need Test::DBIx::Class"
+ }
}
+use_ok('C4::Members::AttributeTypes');
+
use Test::DBIx::Class {
schema_class => 'Koha::Schema',
connect_info => ['dbi:SQLite:dbname=:memory:','',''],
#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-#Testing C4 SocialData
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
-use Test::More tests => 6;
+
+use Test::More;
use Test::MockModule;
+use Module::Load::Conditional qw/check_install/;
+
+BEGIN {
+ if ( check_install( module => 'Test::DBIx::Class' ) ) {
+ plan tests => 6;
+ } else {
+ plan skip_all => "Need Test::DBIx::Class"
+ }
+}
+
BEGIN {
use_ok('C4::SocialData');
}
is( $report->{'without'}->[0]->{'isbn'}, '9780596526740',
'testing get_report' );
+
+1;