From 3cab8ca61bb5638c32168f1522ece19a7183031c Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Fri, 25 Apr 2025 11:46:09 +0200 Subject: [PATCH] Bug 39745: Fix wrong system preference 'language' in test suite (mock_preference) Bug 27490 renamed system preference language to StaffInterfaceLanguages. Needs to be done in test suite on mock_preference calls Test by running impacted tests --- t/db_dependent/Auth.t | 4 ++-- t/db_dependent/Koha/ItemTypes.t | 4 ++-- t/db_dependent/Koha/SharedContent.t | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index 9005d7ca41..616c97f326 100755 --- a/t/db_dependent/Auth.t +++ b/t/db_dependent/Auth.t @@ -526,8 +526,8 @@ subtest 'get_template_and_user' => sub { # Tests for the language URL paramet t::lib::Mocks::mock_preference( 'EnableOpacSearchHistory', 1 ); # Enable es-ES for the OPAC and staff interfaces - t::lib::Mocks::mock_preference( 'OPACLanguages', 'en,es-ES' ); - t::lib::Mocks::mock_preference( 'language', 'en,es-ES' ); + t::lib::Mocks::mock_preference( 'OPACLanguages', 'en,es-ES' ); + t::lib::Mocks::mock_preference( 'StaffInterfaceLanguages', 'en,es-ES' ); # we need a session cookie $ENV{"SERVER_PORT"} = 80; diff --git a/t/db_dependent/Koha/ItemTypes.t b/t/db_dependent/Koha/ItemTypes.t index 352aac8535..aeb7dcb6ab 100755 --- a/t/db_dependent/Koha/ItemTypes.t +++ b/t/db_dependent/Koha/ItemTypes.t @@ -107,8 +107,8 @@ $type = Koha::ItemTypes->find( $child2->itemtype ); ok( defined($type), 'second result' ); is_deeply( $type->unblessed, $child2->unblessed, "We got back the same object" ); -t::lib::Mocks::mock_preference( 'language', 'en' ); -t::lib::Mocks::mock_preference( 'OPACLanguages', 'en' ); +t::lib::Mocks::mock_preference( 'StaffInterfaceLanguages', 'en' ); +t::lib::Mocks::mock_preference( 'OPACLanguages', 'en' ); my $itemtypes = Koha::ItemTypes->search_with_localization; is( $itemtypes->count, $initial_count + 4, 'We added 4 item types' ); my $first_itemtype = $itemtypes->next; diff --git a/t/db_dependent/Koha/SharedContent.t b/t/db_dependent/Koha/SharedContent.t index 8814531539..e901a18493 100755 --- a/t/db_dependent/Koha/SharedContent.t +++ b/t/db_dependent/Koha/SharedContent.t @@ -153,7 +153,7 @@ my $subscription = $builder->build( t::lib::Mocks::mock_userenv( { patron => $loggedinuser } ); -t::lib::Mocks::mock_preference( 'language', 'en' ); +t::lib::Mocks::mock_preference( 'StaffInterfaceLanguages', 'en' ); $post_request = 1; $result = Koha::SharedContent::send_entity( -- 2.43.0