Browse Source

Bug 15836: Fix failing tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
18.11.x
Jonathan Druart 3 years ago
committed by Nick Clemens
parent
commit
e9b5863d6f
  1. 2
      t/Labels_split_ccn.t
  2. 3
      t/db_dependent/Koha/ClassSources.t

2
t/Labels_split_ccn.t

@ -51,7 +51,7 @@ foreach my $ccn (sort keys %$ccns) {
my (@parts, @expected);
ok($ccn, "ddcn: $ccn");
ok(@expected = @{$ccns->{$ccn}}, "split expected to produce " . scalar(@expected) . " pieces");
ok(@parts = C4::Labels::Label::_split_ccn($ccn), "C4::Labels::Label::_split_ccn($ccn)");
ok(@parts = C4::ClassSplitRoutine::Generic::split_callnumber($ccn), "split LCC ($ccn)");
ok(scalar(@expected) == scalar(@parts), sprintf("%d of %d pieces produced", scalar(@parts), scalar(@expected)));
my $i = 0;
foreach my $unit (@expected) {

3
t/db_dependent/Koha/ClassSources.t

@ -33,18 +33,21 @@ $schema->storage->txn_begin;
my $builder = t::lib::TestBuilder->new;
my $class_sort_1 = $builder->build({ source=>'ClassSortRule' });
my $class_sort_2 = $builder->build({ source=>'ClassSortRule' });
my $class_split = $builder->build({ source=>'ClassSplitRule' });
my $nb_of_class_sources = Koha::ClassSources->search->count;
my $new_cs_1 = Koha::ClassSource->new({
cn_source => 'source_1',
description => 'a_test_1',
used => '1',
class_sort_rule => $class_sort_1->{class_sort_rule},#'sort_rule_1',
class_split_rule => $class_split->{class_split_rule},
})->store;
my $new_cs_2 = Koha::ClassSource->new({
cn_source => 'source_2',
description => 'a_test_2',
used => '0',
class_sort_rule => $class_sort_2->{class_sort_rule},#'sort_rule_1',
class_split_rule => $class_split->{class_split_rule},
})->store;
is( $new_cs_1->cn_source, 'source_1', 'Adding a new classification should have set the cn_source');

Loading…
Cancel
Save