Bug 23199: Added tests for Koha::Patron

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Mark Tompsett 2019-07-02 05:01:55 +00:00 committed by Martin Renvoize
parent fa390ca232
commit e53bed5375
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 12 additions and 1 deletions

View File

@ -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;
};