Bug 13167: (QA followup) regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 3e5ea11452)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Tomas Cohen Arazi 2015-01-04 11:14:58 -03:00 committed by Chris Cormack
parent 6fd0165d87
commit 981bdaf8d6
1 changed files with 26 additions and 3 deletions

View File

@ -1,9 +1,24 @@
#!/usr/bin/perl
use strict;
use warnings;
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use C4::Context;
use Test::More tests => 16;
use Test::More tests => 18;
use Test::MockModule;
use DBD::Mock;
@ -74,5 +89,13 @@ eval {
};
ok($@ eq '', 'NormalizeISBN does not throw exception when parsing invalid ISBN (bug 12243)');
eval {
$isbn = C4::Koha::NormalizeISBN({ isbn => '979-10-90085-00-8', format => 'ISBN-10', strip_hyphens => 1 });
};
ok($@ eq '', 'NormalizeISBN does not throw exception when converting to ISBN10 an ISBN starting with 979 (bug 13167)');
ok(!defined $isbn, 'NormalizeISBN returns undef when converting to ISBN10 an ISBN starting with 979 (bug 13167)');
@isbns = GetVariationsOfISBNs('abc');
is(scalar(@isbns), 0, 'zero variations returned of invalid ISBN');
1;