From 33638f13452eb86fd949ba1cec0008a5732a9908 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 17 Nov 2022 10:15:30 +0000 Subject: [PATCH] Bug 24606: (QA follow-up) Add test for encoding/decoding Content-Type: text/plain; charset=utf-8 NOTE: I have the impression that this unit test is quite rudimentary. I do not see the apply function tested? Test plan: Run t/db_dependent/Koha/Item/Templates.t Signed-off-by: Marcel de Rooy --- t/db_dependent/Koha/Item/Templates.t | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Koha/Item/Templates.t b/t/db_dependent/Koha/Item/Templates.t index 1a7bc25556..dca1e66511 100755 --- a/t/db_dependent/Koha/Item/Templates.t +++ b/t/db_dependent/Koha/Item/Templates.t @@ -18,6 +18,7 @@ # along with Koha; if not, see . use Modern::Perl; +use utf8; use Koha::Database; @@ -31,7 +32,7 @@ my $builder = t::lib::TestBuilder->new; use_ok("Koha::Item::Templates"); subtest 'get_available' => sub { - plan tests => 2; + plan tests => 3; $schema->storage->txn_begin; @@ -78,10 +79,12 @@ subtest 'get_available' => sub { { patron_id => $patron_2->id, name => 'My template', - contents => { location => 'test' }, + contents => { location => 'test🙂' }, is_shared => 0, } - )->store(); + )->store; + $unshared_template->discard_changes; # refresh + is( $unshared_template->decoded_contents->{location}, 'test🙂', 'Tested encoding/decoding' ); my $templates = Koha::Item::Templates->get_available( $patron_1->id ); is( $templates->{owned}->count, 1, "Got back one owned template" ); -- 2.30.2