View | Details | Raw Unified | Return to bug 15150
Collapse All | Expand All

(-)a/t/Biblio.t (-2 / +10 lines)
Lines 17-30 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 46;
20
use Test::More;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Warn;
22
use Test::Warn;
23
23
24
use Module::Load::Conditional qw/check_install/;
25
24
BEGIN {
26
BEGIN {
25
        use_ok('C4::Biblio');
27
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
28
        plan tests => 46;
29
    } else {
30
        plan skip_all => "Need Test::DBIx::Class"
31
    }
26
}
32
}
27
33
34
use_ok('C4::Biblio');
35
28
use Test::DBIx::Class {
36
use Test::DBIx::Class {
29
    schema_class => 'Koha::Schema',
37
    schema_class => 'Koha::Schema',
30
    connect_info => ['dbi:SQLite:dbname=:memory:','',''],
38
    connect_info => ['dbi:SQLite:dbname=:memory:','',''],
(-)a/t/Calendar.t (-8 / +32 lines)
Lines 1-20 Link Here
1
#!/usr/bin/env perl
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
2
17
3
use Modern::Perl;
18
use Modern::Perl;
19
20
use Test::More;
21
use Test::MockModule;
22
4
use DateTime;
23
use DateTime;
5
use DateTime::Duration;
24
use DateTime::Duration;
6
use Test::More tests => 35;
7
use Test::MockModule;
8
use Koha::Cache;
25
use Koha::Cache;
9
use Koha::DateUtils;
26
use Koha::DateUtils;
10
27
11
BEGIN {
28
use Module::Load::Conditional qw/check_install/;
12
    use_ok('Koha::Calendar');
13
29
14
    # This was the only test C4 had
30
BEGIN {
15
    # Remove when no longer used
31
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
16
    #use_ok('C4::Calendar'); # not used anymore?
32
        plan tests => 35;
33
    } else {
34
        plan skip_all => "Need Test::DBIx::Class"
35
    }
17
}
36
}
37
38
use_ok('Koha::Calendar');
39
18
use Test::DBIx::Class {
40
use Test::DBIx::Class {
19
    schema_class => 'Koha::Schema',
41
    schema_class => 'Koha::Schema',
20
    connect_info => ['dbi:SQLite:dbname=:memory:','',''],
42
    connect_info => ['dbi:SQLite:dbname=:memory:','',''],
Lines 298-300 my $day_after_christmas = DateTime->new( Link Here
298
                '==', 40, 'Test parameter order not relevant (Days)' );
320
                '==', 40, 'Test parameter order not relevant (Days)' );
299
321
300
}
322
}
323
324
1;
(-)a/t/Images.t (-2 / +28 lines)
Lines 1-11 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
2
#
9
#
3
#Testing C4 Images
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
4
17
5
use Modern::Perl;
18
use Modern::Perl;
6
use Test::More tests => 8;
19
20
use Test::More;
7
use Test::MockModule;
21
use Test::MockModule;
8
22
23
use Module::Load::Conditional qw/check_install/;
24
25
BEGIN {
26
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
27
        plan tests => 8;
28
    } else {
29
        plan skip_all => "Need Test::DBIx::Class"
30
    }
31
}
32
9
use_ok('C4::Images');
33
use_ok('C4::Images');
10
34
11
use Test::DBIx::Class {
35
use Test::DBIx::Class {
Lines 49-51 is( $imagenumbers[0], 1, 'imagenumber is 1' ); Link Here
49
is( $imagenumbers[1], 3, 'imagenumber is 3' );
73
is( $imagenumbers[1], 3, 'imagenumber is 3' );
50
74
51
is( $imagenumbers[4], undef, 'imagenumber undef' );
75
is( $imagenumbers[4], undef, 'imagenumber undef' );
76
77
1;
(-)a/t/ItemType.t (-1 / +29 lines)
Lines 1-9 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
3
use Modern::Perl;
18
use Modern::Perl;
4
use Test::More tests => 25;
19
20
use Test::More;
5
use t::lib::Mocks;
21
use t::lib::Mocks;
6
22
23
use Module::Load::Conditional qw/check_install/;
24
25
BEGIN {
26
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
27
        plan tests => 25;
28
    } else {
29
        plan skip_all => "Need Test::DBIx::Class"
30
    }
31
}
32
7
use_ok('C4::ItemType');
33
use_ok('C4::ItemType');
8
34
9
use Test::DBIx::Class {
35
use Test::DBIx::Class {
Lines 90-92 is( $itemtype->checkinmsg, 'foo', 'checkinmsg is foo' ); Link Here
90
116
91
$itemtype = C4::ItemType->get;
117
$itemtype = C4::ItemType->get;
92
is( $itemtype, undef, 'C4::ItemType->get should return unless if no parameter is given' );
118
is( $itemtype, undef, 'C4::ItemType->get should return unless if no parameter is given' );
119
120
1;
(-)a/t/Koha.t (-1 / +11 lines)
Lines 18-26 Link Here
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use C4::Context;
20
use C4::Context;
21
use Test::More tests => 30;
21
use Test::More;
22
use Test::MockModule;
22
use Test::MockModule;
23
23
24
use Module::Load::Conditional qw/check_install/;
25
26
BEGIN {
27
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
28
        plan tests => 30;
29
    } else {
30
        plan skip_all => "Need Test::DBIx::Class"
31
    }
32
}
33
24
use_ok('C4::Koha');
34
use_ok('C4::Koha');
25
35
26
use Test::DBIx::Class {
36
use Test::DBIx::Class {
(-)a/t/Letters.t (-2 / +11 lines)
Lines 17-25 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use DBI;
21
use Test::MockModule;
20
use Test::MockModule;
22
use Test::More tests => 6;
21
use Test::More;
22
23
use Module::Load::Conditional qw/check_install/;
24
25
BEGIN {
26
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
27
        plan tests => 6;
28
    } else {
29
        plan skip_all => "Need Test::DBIx::Class"
30
    }
31
}
23
32
24
use Test::DBIx::Class {
33
use Test::DBIx::Class {
25
    schema_class => 'Koha::Schema',
34
    schema_class => 'Koha::Schema',
(-)a/t/Matcher.t (-5 / +28 lines)
Lines 1-16 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
2
#
9
#
3
#testing C4 matcher
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
4
19
5
use strict;
20
use Test::More;
6
use warnings;
7
use Test::More tests => 11;
8
use Test::MockModule;
21
use Test::MockModule;
9
22
23
use Module::Load::Conditional qw/check_install/;
24
10
BEGIN {
25
BEGIN {
11
    use_ok('C4::Matcher');
26
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
27
        plan tests => 11;
28
    } else {
29
        plan skip_all => "Need Test::DBIx::Class"
30
    }
12
}
31
}
13
32
33
use_ok('C4::Matcher');
34
14
use Test::DBIx::Class {
35
use Test::DBIx::Class {
15
    schema_class => 'Koha::Schema',
36
    schema_class => 'Koha::Schema',
16
    connect_info => ['dbi:SQLite:dbname=:memory:','',''],
37
    connect_info => ['dbi:SQLite:dbname=:memory:','',''],
Lines 60-62 is( $testmatcher->code(), 'match on ISBN', 'testing code accessor' ); Link Here
60
$testmatcher->description('match on ISSN');
81
$testmatcher->description('match on ISSN');
61
82
62
is( $testmatcher->description(), 'match on ISSN', 'testing code accessor' );
83
is( $testmatcher->description(), 'match on ISSN', 'testing code accessor' );
84
85
1;
(-)a/t/Members_AttributeTypes.t (-3 / +25 lines)
Lines 1-15 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
2
#
14
#
3
# Tests 'fetch', 'fake db data', and 'checks for existant attributes'
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
4
17
5
use Modern::Perl;
18
use Modern::Perl;
19
6
use Test::MockModule;
20
use Test::MockModule;
7
use Test::More tests => 10;
21
use Test::More;
22
23
use Module::Load::Conditional qw/check_install/;
8
24
9
BEGIN {
25
BEGIN {
10
    use_ok('C4::Members::AttributeTypes');
26
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
27
        plan tests => 10;
28
    } else {
29
        plan skip_all => "Need Test::DBIx::Class"
30
    }
11
}
31
}
12
32
33
use_ok('C4::Members::AttributeTypes');
34
13
use Test::DBIx::Class {
35
use Test::DBIx::Class {
14
    schema_class => 'Koha::Schema',
36
    schema_class => 'Koha::Schema',
15
    connect_info => ['dbi:SQLite:dbname=:memory:','',''],
37
    connect_info => ['dbi:SQLite:dbname=:memory:','',''],
(-)a/t/SocialData.t (-3 / +28 lines)
Lines 1-11 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
2
#
14
#
3
#Testing C4 SocialData
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
4
17
5
use Modern::Perl;
18
use Modern::Perl;
6
use Test::More tests => 6;
19
20
use Test::More;
7
use Test::MockModule;
21
use Test::MockModule;
8
22
23
use Module::Load::Conditional qw/check_install/;
24
25
BEGIN {
26
    if ( check_install( module => 'Test::DBIx::Class' ) ) {
27
        plan tests => 6;
28
    } else {
29
        plan skip_all => "Need Test::DBIx::Class"
30
    }
31
}
32
9
BEGIN {
33
BEGIN {
10
    use_ok('C4::SocialData');
34
    use_ok('C4::SocialData');
11
}
35
}
Lines 51-53 is( $report->{'without'}->[0]->{'original'}, Link Here
51
75
52
is( $report->{'without'}->[0]->{'isbn'}, '9780596526740',
76
is( $report->{'without'}->[0]->{'isbn'}, '9780596526740',
53
    'testing get_report' );
77
    'testing get_report' );
54
- 
78
79
1;

Return to bug 15150