|
Lines 19-25
Link Here
|
| 19 |
# with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
# with Koha; if not, see <http://www.gnu.org/licenses>. |
| 20 |
|
20 |
|
| 21 |
use Modern::Perl; |
21 |
use Modern::Perl; |
| 22 |
use Test::More tests => 2; |
22 |
use Test::More tests => 3; |
| 23 |
use MARC::Record; |
23 |
use MARC::Record; |
| 24 |
|
24 |
|
| 25 |
use t::lib::Mocks; |
25 |
use t::lib::Mocks; |
|
Lines 93-98
subtest 'Multiple mappings for one kohafield' => sub {
Link Here
|
| 93 |
'3a | 51', 'TransformMarcToKohaOneField returns biblio.field1' ); |
93 |
'3a | 51', 'TransformMarcToKohaOneField returns biblio.field1' ); |
| 94 |
}; |
94 |
}; |
| 95 |
|
95 |
|
|
|
96 |
subtest 'Testing _adjust_pubyear' => sub { |
| 97 |
plan tests => 8; |
| 98 |
|
| 99 |
is( C4::Biblio::_adjust_pubyear('2004 c2000 2007'), 2000, 'First cYEAR' ); |
| 100 |
is( C4::Biblio::_adjust_pubyear('2004 2000 2007'), 2004, 'First year' ); |
| 101 |
is( C4::Biblio::_adjust_pubyear('18xx 1900'), 1900, '1900 has priority over 18xx' ); |
| 102 |
is( C4::Biblio::_adjust_pubyear('18xx'), 1800, '18xx on its own' ); |
| 103 |
is( C4::Biblio::_adjust_pubyear('197X'), 1970, '197X on its own' ); |
| 104 |
is( C4::Biblio::_adjust_pubyear('1...'), 1000, '1... on its own' ); |
| 105 |
is( C4::Biblio::_adjust_pubyear('12?? 13xx'), 1200, '12?? first' ); |
| 106 |
is( C4::Biblio::_adjust_pubyear('12? 1x'), '12? 1x', 'Too short' ); |
| 107 |
}; |
| 108 |
|
| 96 |
# Cleanup |
109 |
# Cleanup |
| 97 |
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); |
110 |
Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); |
| 98 |
$schema->storage->txn_rollback; |
111 |
$schema->storage->txn_rollback; |
| 99 |
- |
|
|