From 2536c8c4a97c6744bcf03e674be9d6948466b465 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 2 Jul 2019 05:01:55 +0000 Subject: [PATCH] Bug 23199: Added tests for Koha::Patron Content-Type: text/plain; charset=utf-8 Signed-off-by: Mark Tompsett Signed-off-by: Marcel de Rooy --- t/db_dependent/Koha/Patrons.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index bba4dfe2e7..9d5de6bfe3 100644 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -1584,7 +1584,7 @@ subtest 'Test Koha::Patrons::merge' => sub { }; subtest '->store' => sub { - plan tests => 3; + plan tests => 5; my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; @@ -1608,6 +1608,17 @@ subtest '->store' => sub { $patron_1->surname('xxx')->store; is( $patron_1->password, $digest, 'Password should not have changed on ->store'); + # Test uppercasesurname + t::lib::Mocks::mock_preference( 'uppercasesurname', 1 ); + my $surname = lc $patron_1->surname; + $patron_1->surname($surname)->store; + isnt( $patron_1->surname, $surname, + 'Surname converts to uppercase on store.'); + t::lib::Mocks::mock_preference( 'uppercasesurname', 0 ); + $patron_1->surname($surname)->store; + is( $patron_1->surname, $surname, + 'Surname remains unchanged on store.'); + $schema->storage->dbh->{PrintError} = $print_error; $schema->storage->txn_rollback; }; -- 2.11.0