Lines 19-29
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 7; |
22 |
use Test::More tests => 8; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use Koha::Authority::Types; |
25 |
use Koha::Authority::Types; |
26 |
use Koha::Cities; |
26 |
use Koha::Cities; |
|
|
27 |
use Koha::Patron::Category; |
28 |
use Koha::Patron::Categories; |
27 |
use Koha::Patrons; |
29 |
use Koha::Patrons; |
28 |
use Koha::Database; |
30 |
use Koha::Database; |
29 |
|
31 |
|
Lines 80-85
subtest 'not_covered_yet' => sub {
Link Here
|
80 |
plan tests => 1; |
82 |
plan tests => 1; |
81 |
warning_is { Koha::Patrons->search->not_covered_yet } { carped => 'The method not_covered_yet is not covered by tests' }, "If a method is not covered by tests, the AUTOLOAD method won't execute the method"; |
83 |
warning_is { Koha::Patrons->search->not_covered_yet } { carped => 'The method not_covered_yet is not covered by tests' }, "If a method is not covered by tests, the AUTOLOAD method won't execute the method"; |
82 |
}; |
84 |
}; |
|
|
85 |
subtest 'new' => sub { |
86 |
plan tests => 2; |
87 |
my $a_cat_code = 'A_CAT_CODE'; |
88 |
my $patron_category = Koha::Patron::Category->new( { categorycode => $a_cat_code } )->store; |
89 |
is( Koha::Patron::Categories->find($a_cat_code)->category_type, 'A', 'Koha::Object->new should set the default value' ); |
90 |
Koha::Patron::Categories->find($a_cat_code)->delete; |
91 |
$patron_category = Koha::Patron::Category->new( { categorycode => $a_cat_code, category_type => undef } )->store; |
92 |
is( Koha::Patron::Categories->find($a_cat_code)->category_type, 'A', 'Koha::Object->new should set the default value even if the argument exists but is not defined' ); |
93 |
Koha::Patron::Categories->find($a_cat_code)->delete; |
94 |
}; |
83 |
|
95 |
|
84 |
$schema->storage->txn_rollback; |
96 |
$schema->storage->txn_rollback; |
85 |
1; |
97 |
1; |
86 |
- |
98 |
|