|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 9; |
22 |
use Test::More tests => 11; |
| 23 |
|
23 |
|
| 24 |
use Koha::Library; |
24 |
use Koha::Library; |
| 25 |
use Koha::Libraries; |
25 |
use Koha::Libraries; |
|
Lines 27-32
use Koha::LibraryCategory;
Link Here
|
| 27 |
use Koha::LibraryCategories; |
27 |
use Koha::LibraryCategories; |
| 28 |
use Koha::Database; |
28 |
use Koha::Database; |
| 29 |
|
29 |
|
|
|
30 |
use t::lib::Mocks; |
| 30 |
use t::lib::TestBuilder; |
31 |
use t::lib::TestBuilder; |
| 31 |
|
32 |
|
| 32 |
my $schema = Koha::Database->new->schema; |
33 |
my $schema = Koha::Database->new->schema; |
|
Lines 39-44
my $new_library_1 = Koha::Library->new({
Link Here
|
| 39 |
branchcode => 'my_bc_1', |
40 |
branchcode => 'my_bc_1', |
| 40 |
branchname => 'my_branchname_1', |
41 |
branchname => 'my_branchname_1', |
| 41 |
branchnotes => 'my_branchnotes_1', |
42 |
branchnotes => 'my_branchnotes_1', |
|
|
43 |
marcorgcode => 'US-MyLib', |
| 42 |
})->store; |
44 |
})->store; |
| 43 |
my $new_library_2 = Koha::Library->new({ |
45 |
my $new_library_2 = Koha::Library->new({ |
| 44 |
branchcode => 'my_bc_2', |
46 |
branchcode => 'my_bc_2', |
|
Lines 86-89
is( Koha::Libraries->search->count, $nb_of_libraries + 1, 'Delete should have de
Link Here
|
| 86 |
$retrieved_category_2->delete; |
88 |
$retrieved_category_2->delete; |
| 87 |
is( Koha::LibraryCategories->search->count, $nb_of_categories + 2, 'Delete should have deleted the library category' ); |
89 |
is( Koha::LibraryCategories->search->count, $nb_of_categories + 2, 'Delete should have deleted the library category' ); |
| 88 |
|
90 |
|
|
|
91 |
t::lib::Mocks::mock_preference('MARCOrgCode', 'US-Default'); |
| 92 |
is( $new_library_1->get_effective_marcorgcode, 'US-MyLib', 'If defined, use library\'s own marc org code'); |
| 93 |
is( $new_library_2->get_effective_marcorgcode, 'US-Default', 'If not defined library\' marc org code, use the one from system preferences'); |
| 94 |
|
| 89 |
$schema->storage->txn_rollback; |
95 |
$schema->storage->txn_rollback; |
| 90 |
- |
|
|