From 0c755efd1fe43ec6fafe3155b3477bf14e8f8396 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Oct 2021 11:42:48 +0200 Subject: [PATCH] Bug 27944: Fix t/db_dependent/AuthorisedValues.t # Failed test 'The second category should be correct (ordered by category name)' # at t/db_dependent/AuthorisedValues.t line 141. # got: 'AR_CANCELLATION' # expected: 'av_for_testing' Signed-off-by: Jonathan Druart --- t/db_dependent/AuthorisedValues.t | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t index e16f1faa89..d39d13170c 100755 --- a/t/db_dependent/AuthorisedValues.t +++ b/t/db_dependent/AuthorisedValues.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use Modern::Perl; -use Test::More tests => 17; +use Test::More tests => 16; use Try::Tiny; use t::lib::TestBuilder; @@ -137,8 +137,11 @@ is( @$limits, 2, 'library_limits functions correctly both as setter and getter' my @categories = Koha::AuthorisedValues->new->categories; is( @categories, @existing_categories+3, 'There should have 3 categories inserted' ); -is( $categories[0], $av4->category, 'The first category should be correct (ordered by category name)' ); -is( $categories[1], $av1->category, 'The second category should be correct (ordered by category name)' ); +is_deeply( + \@categories, + [ sort { uc $a cmp uc $b } @categories ], + 'categories must be ordered by category names' +); subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { plan tests => 5;