Bugzilla – Attachment 89581 Details for
Bug 11853
Cannot clear date of birth via OPAC patron update
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11853: Add tests
Bug-11853-Add-tests.patch (text/plain), 2.56 KB, created by
Katrin Fischer
on 2019-05-11 09:20:06 UTC
(
hide
)
Description:
Bug 11853: Add tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-05-11 09:20:06 UTC
Size:
2.56 KB
patch
obsolete
>From 7a373aa6d1fdd1f0435a949263277bade5d7b5b5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 8 May 2019 16:37:40 -0500 >Subject: [PATCH] Bug 11853: Add tests > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Koha/Patron/Modifications.t | 41 +++++++++++++++++++++++++++++- > 1 file changed, 40 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patron/Modifications.t b/t/db_dependent/Koha/Patron/Modifications.t >index ed4c9b39c6..38b3ef2dc8 100755 >--- a/t/db_dependent/Koha/Patron/Modifications.t >+++ b/t/db_dependent/Koha/Patron/Modifications.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use utf8; > >-use Test::More tests => 6; >+use Test::More tests => 7; > use Test::Exception; > > use t::lib::TestBuilder; >@@ -372,3 +372,42 @@ subtest 'pending_count() and pending() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'dateofbirth tests' => sub { >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ # Cleaning the field >+ my $patron = $builder->build_object( { class => 'Koha::Patrons', value => { dateofbirth => '1980-01-01' } } ); >+ my $patron_modification = Koha::Patron::Modification->new( { borrowernumber => $patron->borrowernumber, dateofbirth => undef } >+ )->store; >+ $patron_modification->approve; >+ >+ $patron->discard_changes; >+ is( $patron->dateofbirth, undef, 'dateofbirth must a been set to NULL if required' ); >+ >+ # FIXME ->approve must have been removed it, but it did not. There may be an hidden bug here. >+ Koha::Patron::Modifications->search({ borrowernumber => $patron->borrowernumber })->delete; >+ >+ # Adding a dateofbirth >+ $patron_modification = Koha::Patron::Modification->new( { borrowernumber => $patron->borrowernumber, dateofbirth => '1980-02-02' } >+ )->store; >+ $patron_modification->approve; >+ >+ $patron->discard_changes; >+ is( $patron->dateofbirth, '1980-02-02', 'dateofbirth must a been set' ); >+ >+ # FIXME ->approve must have been removed it, but it did not. There may be an hidden bug here. >+ Koha::Patron::Modifications->search({ borrowernumber => $patron->borrowernumber })->delete; >+ >+ # Modifying a dateofbirth >+ $patron_modification = Koha::Patron::Modification->new( { borrowernumber => $patron->borrowernumber, dateofbirth => '1980-03-03' } >+ )->store; >+ $patron_modification->approve; >+ >+ $patron->discard_changes; >+ is( $patron->dateofbirth, '1980-03-03', 'dateofbirth must a been updated' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11853
:
89480
|
89481
|
89483
|
89484
|
89580
|
89581
|
90321