From b5f1ed30e05ef549e8a09f197642a67ced665378 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 28 Oct 2021 15:16:03 +0200 Subject: [PATCH] Bug 28948: Fix tests t/db_dependent/Koha/REST/Plugin/Objects.t .............. 12/13 # Failed test 'Public representation of $library_1 is retrieved' # at t/db_dependent/Koha/REST/Plugin/Objects.t line 546. # Structures begin differing at: # $got->{country} = 'cCaL3l' # $expected->{country} = 'jcxuV1zl' # Failed test 'Public representation of $library_2 is retrieved' # at t/db_dependent/Koha/REST/Plugin/Objects.t line 546. # Structures begin differing at: # $got->{state} = 'QVAutHLBs' # $expected->{state} = 'hZotjENErQ' # Looks like you failed 2 tests of 3. --- t/db_dependent/Koha/REST/Plugin/Objects.t | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Koha/REST/Plugin/Objects.t b/t/db_dependent/Koha/REST/Plugin/Objects.t index 47a953a8347..9bff09d9c4d 100755 --- a/t/db_dependent/Koha/REST/Plugin/Objects.t +++ b/t/db_dependent/Koha/REST/Plugin/Objects.t @@ -89,7 +89,10 @@ get '/libraries/:library_id_1/:library_id_2' => sub { my $library_id_1 = $c->param('library_id_1'); my $library_id_2 = $c->param('library_id_2'); - my $libraries_rs = Koha::Libraries->search({ branchcode => [ $library_id_1, $library_id_2 ] }); + my $libraries_rs = Koha::Libraries->search( + { branchcode => [ $library_id_1, $library_id_2 ] }, + { order_by => 'branchname' } + ); my $libraries = $c->objects->search( $libraries_rs ); $c->render( @@ -538,8 +541,8 @@ subtest 'objects.search helper, public requests' => sub { $schema->storage->txn_begin; - my $library_1 = $builder->build_object({ class => 'Koha::Libraries' }); - my $library_2 = $builder->build_object({ class => 'Koha::Libraries' }); + my $library_1 = $builder->build_object({ class => 'Koha::Libraries', value => { branchname => 'A' } }); + my $library_2 = $builder->build_object({ class => 'Koha::Libraries', value => { branchname => 'B' } }); my $t = Test::Mojo->new; -- 2.25.1