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:
parent
fa390ca232
commit
e53bed5375
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue