3 # Copyright 2020 Rijksmuseum
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20 # Testing private routine C4::Serials::_handle_seqno of ModSerialStatus
23 use Data
::Dumper qw
/Dumper/;
25 use Test
::More tests
=> 8;
29 # Testing C4::Serials::_handle_seqno
30 my $list = '2017 (No. 8); 2017 (No. 9); 2017 (No. 10)';
31 is
( C4
::Serials
::_handle_seqno
( '2017 (No. 8)', $list ), $list, 'Not added 8' );
32 is
( C4
::Serials
::_handle_seqno
( '2017 (No. 9)', $list ), $list, 'Not added 9' );
33 is
( C4
::Serials
::_handle_seqno
( '2017 (No. 10)', $list ), $list, 'Not added 10' );
34 is
( C4
::Serials
::_handle_seqno
( '2017 (No. 11)', $list ), $list.'; 2017 (No. 11)', 'Added 11' );
35 is
( C4
::Serials
::_handle_seqno
( '2017 (No. 7)', $list, 'REMOVE'), $list, 'Not removed 7' );
36 is
( C4
::Serials
::_handle_seqno
( '2017 (No. 10)', $list, 'REMOVE') !~ /\(10\)/, 1, 'Removed 10' );
37 is
( C4
::Serials
::_handle_seqno
( '2017 (No. 8)', $list, 'CHECK'), 1, 'Found 8' );
38 is
( C4
::Serials
::_handle_seqno
( '2017 (No. 11)', $list, 'CHECK'), q{}, 'Not found 11' );