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

(-)a/t/Csv.t (-3 / +5 lines)
Lines 6-14 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 1;
9
use Test::More tests => 4;
10
10
11
BEGIN {
11
BEGIN {
12
        use_ok('C4::Csv');
12
        use_ok('C4::Csv');
13
}
13
}
14
14
15
- 
15
ok(C4::Csv::GetCsvProfiles(), 'test getting csv profiles');
16
--
16
is(C4::Csv::GetCsvProfile(),undef, 'test getting csv profiles');
17
18
ok(C4::Csv::GetCsvProfilesLoop(), 'test getting profile loop');
17
t/Labels.t |   10 +++++++++-
19
t/Labels.t |   10 +++++++++-
18
1 files changed, 9 insertions(+), 1 deletions(-)
20
1 files changed, 9 insertions(+), 1 deletions(-)
(-)a/t/Labels.t (-3 / +9 lines)
Lines 20-26 Link Here
20
use strict;
20
use strict;
21
use warnings;
21
use warnings;
22
22
23
use Test::More tests => 2;
23
use Test::More tests => 6;
24
24
25
BEGIN {
25
BEGIN {
26
    use_ok('C4::Labels::Label');
26
    use_ok('C4::Labels::Label');
Lines 33-35 my $expected_fields = [ Link Here
33
    { code => 'itemcallnumber', desc => 'itemcallnumber' }, 
33
    { code => 'itemcallnumber', desc => 'itemcallnumber' }, 
34
];
34
];
35
is_deeply($parsed_fields, $expected_fields, '"callnumber" in label layout alias for "itemcallnumber" per bug 5653');
35
is_deeply($parsed_fields, $expected_fields, '"callnumber" in label layout alias for "itemcallnumber" per bug 5653');
36
- 
36
37
is(C4::Labels::Label::_check_params(),"0",'test checking parameters');
38
39
ok(C4::Labels::Label::_guide_box(), 'test guide box with nothing entered');
40
41
ok(C4::Labels::Label::_get_text_fields(), 'test getting textx fields');
42
43
is(C4::Labels::Label::_split_lccn(),"0", 'test when _split_lccn is null');
37
C4/AuthoritiesMarc/MARC21.pm
44
C4/AuthoritiesMarc/MARC21.pm
38
--
39
t/AuthoritiesMarc_MARC21.t |    9 ++++++++-
45
t/AuthoritiesMarc_MARC21.t |    9 ++++++++-
40
1 files changed, 8 insertions(+), 1 deletions(-)
46
1 files changed, 8 insertions(+), 1 deletions(-)
(-)a/t/AuthoritiesMarc_MARC21.t (-3 / +8 lines)
Lines 6-14 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 1;
9
use Test::More tests => 4;
10
use MARC::Record;
10
11
11
BEGIN {
12
BEGIN {
12
        use_ok('C4::AuthoritiesMarc::MARC21');
13
        use_ok('C4::AuthoritiesMarc::MARC21');
13
}
14
}
14
15
15
- 
16
my @result = C4::AuthoritiesMarc::MARC21::default_auth_type_location();
17
ok($result[0] eq '942', "testing default_auth_type_location has first value '942'");
18
ok($result[1] eq 'a', "testing default_auth_type_location has first value 'a'");
19
20
my $marc_record = MARC::Record->new();
21
is(C4::AuthoritiesMarc::MARC21::fix_marc21_auth_type_location($marc_record, '', ''), undef, "testing fix_marc21_auth_type_location returns undef with empty MARC record");
16
C4/Barcodes_PrinterConfig.pm
22
C4/Barcodes_PrinterConfig.pm
17
--
18
t/Barcodes_PrinterConfig.t |   10 +++++++++-
23
t/Barcodes_PrinterConfig.t |   10 +++++++++-
19
1 files changed, 9 insertions(+), 1 deletions(-)
24
1 files changed, 9 insertions(+), 1 deletions(-)
(-)a/t/Barcodes_PrinterConfig.t (-3 / +9 lines)
Lines 6-14 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 1;
9
use Test::More tests => 6;
10
10
11
BEGIN {
11
BEGIN {
12
        use_ok('C4::Barcodes::PrinterConfig');
12
        use_ok('C4::Barcodes::PrinterConfig');
13
}
13
}
14
14
15
- 
15
is(C4::Barcodes::PrinterConfig::setPositionsForY(), "0", "testing setPositionsForY returns'0' when given no arguments");
16
--
16
is(C4::Barcodes::PrinterConfig::setPositionsForX(), "0", "testing setPositionsForX returns'0' when given no arguments");
17
18
is(C4::Barcodes::PrinterConfig::setPositionsForY(undef, undef, 5), "5", "testing setPositionsForY returns'5' when given (undef, undef, 5)");
19
is(C4::Barcodes::PrinterConfig::setPositionsForX(undef, undef, 5), "5", "testing setPositionsForX returns'5' when given (undef, undef, 5)");
20
21
22
is(C4::Barcodes::PrinterConfig::labelsPage(), "0", "testing labelsPage returns'0' when given no arguments");
17
t/ClassSortRoutine_LCC.t |   15 ++++++++++++++-
23
t/ClassSortRoutine_LCC.t |   15 ++++++++++++++-
18
1 files changed, 14 insertions(+), 1 deletions(-)
24
1 files changed, 14 insertions(+), 1 deletions(-)
(-)a/t/ClassSortRoutine_LCC.t (-3 / +14 lines)
Lines 6-14 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 1;
9
use Test::More tests => 9;
10
10
11
BEGIN {
11
BEGIN {
12
        use_ok('C4::ClassSortRoutine::LCC');
12
        use_ok('C4::ClassSortRoutine::LCC');
13
}
13
}
14
14
15
- 
15
#Obvious cases
16
--
16
is(C4::ClassSortRoutine::LCC::get_class_sort_key(), "", "No arguments returns an empty string");
17
is(C4::ClassSortRoutine::LCC::get_class_sort_key('a','b'), "A_B", "Arguments 'a','b' return 'A_B'");
18
19
#spaces in arguements
20
is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ','b'), "B_", "Arguments ' ','b' return 'B_'");
21
is(C4::ClassSortRoutine::LCC::get_class_sort_key('a',' '), "A_", "Arguments 'a',' ' return 'A_'");
22
is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ','    '), "", "Arguments ' ','    ' return ''");
23
24
#'funky cases' based on regex in code
25
is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','b'), "_B", "Arguments '.','b' return '_B'");
26
is(C4::ClassSortRoutine::LCC::get_class_sort_key('....','........'), "_______", "Arguments '....','........' return '_______'");
27
is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','.'), "__", "Arguments '.','.' return '__'");
17
t/Creators.t |   33 ++++++++++++++++++++++++++++++++-
28
t/Creators.t |   33 ++++++++++++++++++++++++++++++++-
18
1 files changed, 32 insertions(+), 1 deletions(-)
29
1 files changed, 32 insertions(+), 1 deletions(-)
(-)a/t/Creators.t (-3 / +32 lines)
Lines 6-14 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 1;
9
use Test::More tests => 15;
10
10
11
BEGIN {
11
BEGIN {
12
        use_ok('C4::Creators');
12
        use_ok('C4::Creators');
13
        use_ok('C4::Creators::PDF');
13
}
14
}
14
15
15
- 
16
my $pdf_creator = C4::Creators::PDF->new('test.pdf' => '', InitVars => 0);
16
--
17
ok($pdf_creator, "testing new() works");
18
if (-e 'test.pdf') {
19
  pass('testing pdf file created');
20
}
21
else {
22
  fail('testing pdf file created');
23
}
24
25
ok($pdf_creator->Add(""), "testing Add() works");
26
ok($pdf_creator->Bookmark({}), "testing Bookmark() works");
27
ok($pdf_creator->Compress(1), "testing Compress() works");
28
29
is($pdf_creator->Font("H"), "Ft1", "testing Font() works");
30
is($pdf_creator->FontSize(), '12', "testing FontSize() is set to 12 by default");
31
my @result = $pdf_creator->FontSize(14);
32
is($result[0], '14', "testing FontSize() can be set to a different value");
33
$pdf_creator->FontSize(); # Reset font size before testing text width etc below
34
35
ok($pdf_creator->Page(), "testing Page() works");
36
37
is($pdf_creator->StrWidth("test", "H", 12), '19.344', "testing StrWidth() returns correct point width");
38
39
@result = $pdf_creator->Text(10, 10, "test");
40
is($result[0], '10', "testing Text() writes from a given x-value");
41
is($result[1], '29.344', "testing Text() writes to the correct x-value");
42
43
ok($pdf_creator->End(), "testing End() works");
44
45
unlink 'test.pdf';
17
t/Ris.t |   10 +++++++++-
46
t/Ris.t |   10 +++++++++-
18
1 files changed, 9 insertions(+), 1 deletions(-)
47
1 files changed, 9 insertions(+), 1 deletions(-)
(-)a/t/Ris.t (-3 / +9 lines)
Lines 6-14 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 1;
9
use Test::More tests => 6;
10
10
11
BEGIN {
11
BEGIN {
12
        use_ok('C4::Ris');
12
        use_ok('C4::Ris');
13
}
13
}
14
14
15
- 
15
is(C4::Ris::print_typetag(),undef,'test printing typetag');
16
--
16
17
is(C4::Ris::print_title(),undef, 'test printing title when print_title is nil');
18
19
is(C4::Ris::print_stitle(),undef, 'test printing info from series title field when its nil');
20
21
ok((C4::Ris::charconv('hello world'))[0] eq 'hello world', 'testing that it returns what you entered');
22
ok(C4::Ris::charconv() == 0, 'testing when charconv is nil');
17
t/Scheduler.t |    7 ++++++-
23
t/Scheduler.t |    7 ++++++-
18
1 files changed, 6 insertions(+), 1 deletions(-)
24
1 files changed, 6 insertions(+), 1 deletions(-)
(-)a/t/Scheduler.t (-3 / +6 lines)
Lines 6-14 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 1;
9
use Test::More tests => 6;
10
10
11
BEGIN {
11
BEGIN {
12
        use_ok('C4::Scheduler');
12
        use_ok('C4::Scheduler');
13
}
13
}
14
14
15
- 
15
ok(C4::Scheduler::get_jobs(), "testing get_jobs with no arguments");
16
--
16
ok(C4::Scheduler::get_at_jobs(), "testing get_at_jobs with no arguments");
17
is(C4::Scheduler::get_at_job(), "0", "testing get_at_job returns '0' when given no arguments");
18
is(C4::Scheduler::add_at_job(), "", "testing add_at_job with no arguments");
19
is(C4::Scheduler::remove_at_job(), undef , "testing remove_at_job returns undef when given no arguments");
17
t/db_dependent/Serials.t |   56 +++++++++++++++++++++++++++++++++++++++++++++-
20
t/db_dependent/Serials.t |   56 +++++++++++++++++++++++++++++++++++++++++++++-
18
1 files changed, 55 insertions(+), 1 deletions(-)
21
1 files changed, 55 insertions(+), 1 deletions(-)
(-)a/t/db_dependent/Serials.t (-3 / +55 lines)
Lines 9-15 use YAML; Link Here
9
9
10
use C4::Serials;
10
use C4::Serials;
11
use C4::Debug;
11
use C4::Debug;
12
use Test::More tests => 5;
12
use Test::More tests => 33;
13
13
14
BEGIN {
14
BEGIN {
15
    use_ok('C4::Serials');
15
    use_ok('C4::Serials');
Lines 40-42 if ($subscriptioninformation->{periodicity} % 16==0){ Link Here
40
my $expirationdate = GetExpirationDate(1) ;
40
my $expirationdate = GetExpirationDate(1) ;
41
ok( $expirationdate, "not NULL" );
41
ok( $expirationdate, "not NULL" );
42
$debug && warn "$expirationdate";
42
$debug && warn "$expirationdate";
43
- 
43
44
--
44
is(C4::Serials::GetLateIssues(),"0", 'test getting late issues');
45
46
ok(C4::Serials::GetSubscriptionHistoryFromSubscriptionId(), 'test getting history from sub-scription');
47
48
ok(C4::Serials::GetSerialStatusFromSerialId(), 'test getting Serial Status From Serial Id');
49
50
ok(C4::Serials::GetSerialInformation(), 'test getting Serial Information');
51
52
ok(C4::Serials::AddItem2Serial(), 'test adding item to serial');
53
54
ok(C4::Serials::UpdateClaimdateIssues(), 'test updating claim date');
55
56
ok(C4::Serials::GetFullSubscription(), 'test getting full subscription');
57
58
ok(C4::Serials::PrepareSerialsData(), 'test preparing serial data');
59
60
ok(C4::Serials::GetSubscriptionsFromBiblionumber(), 'test getting subscriptions form biblio number');
61
62
is(C4::Serials::GetSerials(),"0", 'test getting serials when you enter nothing');
63
is(C4::Serials::GetSerials2(),"0", 'test getting serials when you enter nothing');
64
65
ok(C4::Serials::GetLatestSerials(), 'test getting lastest serials');
66
67
is(C4::Serials::GetDistributedTo(),"0", 'test getting distributed when nothing is entered');
68
69
is(C4::Serials::GetNextSeq(),"0", 'test getting next seq when you enter nothing');
70
71
is(C4::Serials::GetSeq(),undef, 'test getting seq when you enter nothing');
72
73
is(C4::Serials::CountSubscriptionFromBiblionumber(),"0", 'test counting subscription when nothing is entered');
74
75
is(C4::Serials::ModSubscriptionHistory(),"0", 'test modding subscription history');
76
77
is(C4::Serials::ModSerialStatus(),undef, 'test modding serials');
78
79
is(C4::Serials::NewIssue(),"0", 'test getting 0 when nothing is entered');
80
81
is(C4::Serials::ItemizeSerials(),undef, 'test getting nothing when nothing is entered');
82
83
ok(C4::Serials::HasSubscriptionStrictlyExpired(), 'test if the subscriptions has expired');
84
is(C4::Serials::HasSubscriptionExpired(),"0", 'test if the subscriptions has expired');
85
86
is(C4::Serials::GetLateOrMissingIssues(),"0", 'test getting last or missing issues');
87
88
is(C4::Serials::removeMissingIssue(),undef, 'test removing a missing issue');
89
90
is(C4::Serials::updateClaim(),undef, 'test updating claim');
91
92
is(C4::Serials::getsupplierbyserialid(),undef, 'test getting supplier idea');
93
94
is(C4::Serials::check_routing(),"0", 'test checking route');
95
96
is(C4::Serials::addroutingmember(),undef, 'test adding route member');
45
t/Search_PazPar2.t |   10 +++++++++-
97
t/Search_PazPar2.t |   10 +++++++++-
46
1 files changed, 9 insertions(+), 1 deletions(-)
98
1 files changed, 9 insertions(+), 1 deletions(-)
(-)a/t/Search_PazPar2.t (-3 / +9 lines)
Lines 6-14 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 1;
9
use Test::More tests => 8;
10
10
11
BEGIN {
11
BEGIN {
12
        use_ok('C4::Search::PazPar2');
12
        use_ok('C4::Search::PazPar2');
13
}
13
}
14
14
15
- 
15
my $obj = C4::Search::PazPar2->new();
16
--
16
ok ($obj, "testing new works");
17
is ($obj->init(), "1", "testing init returns '1' when given no arguments");
18
is ($obj->search(), "1", "testing search returns '1' when given no arguments");
19
is ($obj->stat(), undef, "testing stat returns undef when given no arguments");
20
is ($obj->show(), undef, "testing show returns undef when given no arguments");
21
is ($obj->record(), undef, "testing record returns undef when given no arguments");
22
is ($obj->termlist(), undef, "testing termlist returns undef when given no arguments");
17
t/TmplToken.t |   26 +++++++++++++++++++++++++-
23
t/TmplToken.t |   26 +++++++++++++++++++++++++-
18
1 files changed, 25 insertions(+), 1 deletions(-)
24
1 files changed, 25 insertions(+), 1 deletions(-)
(-)a/t/TmplToken.t (-3 / +25 lines)
Lines 6-12 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
use C4::TmplTokenType;
8
use C4::TmplTokenType;
9
use Test::More tests => 7;
9
use Test::More tests => 19;
10
10
11
BEGIN {
11
BEGIN {
12
        use_ok('C4::TmplToken');
12
        use_ok('C4::TmplToken');
Lines 20-22 ok ($token->pathname eq '/tmp/translate.txt', "Path works"); Link Here
20
20
21
21
22
ok ($token->text_p, "text_p works");
22
ok ($token->text_p, "text_p works");
23
- 
23
24
is($token-> children(), undef, "testing children returns undef when given argument");
25
26
ok($token-> set_children(), "testing set_children with no arguments");
27
28
is($token-> parameters_and_fields(), "0", "testing Parameters and fields returns 0 when given argument");
29
30
is($token-> anchors(), "0", "testing anchors returns 0 when given argument");
31
32
is($token-> form(),undef, "testing form returns undef when given argument");
33
34
ok($token-> set_form(), "testing set_form with no arguments");
35
36
is($token-> js_data(),undef, "testing form returns undef when given argument");
37
38
ok($token-> set_js_data(), "testing set_js_data with no arguments");
39
40
is($token-> tag_p(),"", "testing tag_p returns '' when given argument");
41
42
is($token-> cdata_p(),"", "testing cdata_p returns '' when given argument");
43
44
is($token-> text_parametrized_p(),"", "testing text_parametrized returns '' when given argument");
45
46
is($token-> directive_p(),"", "testing directive_p returns '' when given argument");
24
C4/SIP/ILS/Transaction/Renew.pm
47
C4/SIP/ILS/Transaction/Renew.pm
25
--
26
t/db_dependent/SIP_ILS.t |    4 ++++
48
t/db_dependent/SIP_ILS.t |    4 ++++
27
1 files changed, 4 insertions(+), 0 deletions(-)
49
1 files changed, 4 insertions(+), 0 deletions(-)
(-)a/t/db_dependent/SIP_ILS.t (-2 / +4 lines)
Lines 27-29 $transaction2->patron(my $patron2 = ILS::Patron->new("ABCDE12345")); Link Here
27
ok(!defined $patron2, "patron code: ABCDE12345 is invalid");
27
ok(!defined $patron2, "patron code: ABCDE12345 is invalid");
28
28
29
ok($transaction->do_renew_all(), "items renewed correctly");
29
ok($transaction->do_renew_all(), "items renewed correctly");
30
- 
30
31
--
31
32
my $object = ILS::Transaction::Renew->new();
33
is($object->do_renew(), "", "");
32
t/Languages.t |    7 ++++++-
34
t/Languages.t |    7 ++++++-
33
1 files changed, 6 insertions(+), 1 deletions(-)
35
1 files changed, 6 insertions(+), 1 deletions(-)
(-)a/t/Languages.t (-2 / +6 lines)
Lines 6-14 Link Here
6
use strict;
6
use strict;
7
use warnings;
7
use warnings;
8
8
9
use Test::More tests => 1;
9
use Test::More tests => 4;
10
10
11
BEGIN {
11
BEGIN {
12
        use_ok('C4::Languages');
12
        use_ok('C4::Languages');
13
}
13
}
14
14
15
- 
15
isnt(C4::Languages::_get_themes(), undef, 'testing _get_themes doesnt return undef');
16
17
ok(C4::Languages::_get_language_dirs(), 'test getting _get_language_dirs');
18
19
is(C4::Languages::accept_language(),undef, 'test that accept_languages returns undef when nothing is entered');

Return to bug 5327