Created attachment 53342 [details] [review] Bug 16912: Koha::Patrons - Move and rewrite tests for AddEnrolmentFeeIfNeeded
Created attachment 53343 [details] [review] Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to ->add_enrolment_fee_if_needed This patch moves the code of the C4::Members::AddEnrolmentFeeIfNeeded subroutine to the Koha::Patron->add_enrolment_fee_if_needed method. The behavior should be unchanged. Test plan: 1/ Define enrolment fee for 2 patron categories 2/ Create a patron using the first category => The patron should be charged 3/ Change the patron category to the other one => The patron should be charged again
Created attachment 53519 [details] [review] Bug 16912: Koha::Patrons - Move and rewrite tests for AddEnrolmentFeeIfNeeded
Created attachment 53520 [details] [review] Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to ->add_enrolment_fee_if_needed This patch moves the code of the C4::Members::AddEnrolmentFeeIfNeeded subroutine to the Koha::Patron->add_enrolment_fee_if_needed method. The behavior should be unchanged. Test plan: 1/ Define enrolment fee for 2 patron categories 2/ Create a patron using the first category => The patron should be charged 3/ Change the patron category to the other one => The patron should be charged again
I d't understand why this is under Acquisitions. Shouldn't it be under Patrons or circulation
I think it was a mistake - well spotted!
fatal: sha1 information is lacking or useless (t/db_dependent/Koha/Patrons.t)
(In reply to Aleisha Amohia from comment #7) > fatal: sha1 information is lacking or useless (t/db_dependent/Koha/Patrons.t) Apply cleanly on top of bug 16911.
(In reply to Jonathan Druart from comment #3) > Created attachment 53519 [details] [review] [review] > Bug 16912: Koha::Patrons - Move and rewrite tests for AddEnrolmentFeeIfNeeded Tests failed: prove t/db_dependent/Koha/Patrons.t t/db_dependent/Koha/Patrons.t .. 1/8 Violation of unique constraint in Category at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 201. Violation of unique constraint in Category at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 201. Violation of unique constraint in Category at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 201. # Failed test 'New kid pay 5' # at t/db_dependent/Koha/Patrons.t line 200. # got: '0' # expected: '5' # Failed test 'Kid growing and become a juvenile, but shouldn't pay for the upgrade ' # at t/db_dependent/Koha/Patrons.t line 206. # got: '0' # expected: '5' # Failed test 'Kid growing and become a juvenile, he should pay 15' # at t/db_dependent/Koha/Patrons.t line 215. # got: '0' # expected: '15' # Failed test 'Juvenile growing and become an young adult, he should pay 35' # at t/db_dependent/Koha/Patrons.t line 222. # got: '0' # expected: '35' # Looks like you failed 4 tests of 4. # Failed test 'add_enrolment_fee_if_needed' # at t/db_dependent/Koha/Patrons.t line 228. # Looks like you failed 1 test of 8. t/db_dependent/Koha/Patrons.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/8 subtests Test Summary Report ------------------- t/db_dependent/Koha/Patrons.t (Wstat: 256 Tests: 8 Failed: 1) Failed test: 7 Non-zero exit status: 1 Files=1, Tests=8, 2 wallclock secs ( 0.03 usr 0.00 sys + 2.12 cusr 0.09 csys = 2.24 CPU) Result: FAIL The enrolment fee behaviour all works as expected, so happy to sign off once the tests pass.
Created attachment 54798 [details] [review] [SIGNED-OFF] Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to ->add_enrolment_fee_if_needed This patch moves the code of the C4::Members::AddEnrolmentFeeIfNeeded subroutine to the Koha::Patron->add_enrolment_fee_if_needed method. The behavior should be unchanged. Test plan: 1/ Define enrolment fee for 2 patron categories 2/ Create a patron using the first category => The patron should be charged 3/ Change the patron category to the other one => The patron should be charged again Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Created attachment 54804 [details] [review] Bug 16912: Update patron category enrolment fees
Created attachment 54836 [details] [review] [SIGNED-OFF] Bug 16912: Koha::Patrons - Move and rewrite tests for AddEnrolmentFeeIfNeeded Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Created attachment 54837 [details] [review] Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to ->add_enrolment_fee_if_needed This patch moves the code of the C4::Members::AddEnrolmentFeeIfNeeded subroutine to the Koha::Patron->add_enrolment_fee_if_needed method. The behavior should be unchanged. Test plan: 1/ Define enrolment fee for 2 patron categories 2/ Create a patron using the first category => The patron should be charged 3/ Change the patron category to the other one => The patron should be charged again Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Created attachment 54838 [details] [review] [SIGNED-OFF] Bug 16912: Update patron category enrolment fees Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
All tests pass and patch works as described, signing off.
16911 is in master: Applying: Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to ->add_enrolment_fee_if_needed fatal: sha1 information is lacking or useless (C4/Members.pm). Repository lacks necessary blobs to fall back on 3-way merge.
Created attachment 56493 [details] [review] Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to ->add_enrolment_fee_if_needed This patch moves the code of the C4::Members::AddEnrolmentFeeIfNeeded subroutine to the Koha::Patron->add_enrolment_fee_if_needed method. The behavior should be unchanged. Test plan: 1/ Define enrolment fee for 2 patron categories 2/ Create a patron using the first category => The patron should be charged 3/ Change the patron category to the other one => The patron should be charged again Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Created attachment 56494 [details] [review] Bug 16912: Koha::Patrons - Move and rewrite tests for AddEnrolmentFeeIfNeeded Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Created attachment 56495 [details] [review] Bug 16912: Update patron category enrolment fees Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Created attachment 56526 [details] [review] Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to ->add_enrolment_fee_if_needed This patch moves the code of the C4::Members::AddEnrolmentFeeIfNeeded subroutine to the Koha::Patron->add_enrolment_fee_if_needed method. The behavior should be unchanged. Test plan: 1/ Define enrolment fee for 2 patron categories 2/ Create a patron using the first category => The patron should be charged 3/ Change the patron category to the other one => The patron should be charged again Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 56527 [details] [review] Bug 16912: Koha::Patrons - Move and rewrite tests for AddEnrolmentFeeIfNeeded Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 56528 [details] [review] Bug 16912: Update patron category enrolment fees Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Looks like this may need a rebase and a unit test fix up: t/db_dependent/Koha/Patrons.t .. 8/11 Violation of unique constraint in Category at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 201. Violation of unique constraint in Category at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 201. Violation of unique constraint in Category at /home/vagrant/kohaclone/t/lib/TestBuilder.pm line 201. # Failed test 'New kid pay 5' # at t/db_dependent/Koha/Patrons.t line 276. # got: '0' # expected: '5' # Failed test 'Kid growing and become a juvenile, but shouldn't pay for the upgrade ' # at t/db_dependent/Koha/Patrons.t line 282. # got: '0' # expected: '5' # Failed test 'Kid growing and become a juvenile, he should pay 15' # at t/db_dependent/Koha/Patrons.t line 291. # got: '0' # expected: '15' # Failed test 'Juvenile growing and become an young adult, he should pay 35' # at t/db_dependent/Koha/Patrons.t line 298. # got: '0' # expected: '35' # Looks like you failed 4 tests of 4. # Failed test 'add_enrolment_fee_if_needed' # at t/db_dependent/Koha/Patrons.t line 304. # Looks like you failed 1 test of 11. t/db_dependent/Koha/Patrons.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/11 subtests Test Summary Report ------------------- t/db_dependent/Koha/Patrons.t (Wstat: 256 Tests: 11 Failed: 1) Failed test: 10 Non-zero exit status: 1 Files=1, Tests=11, 2 wallclock secs ( 0.04 usr 0.00 sys + 1.80 cusr 0.15 csys = 1.99 CPU) Result: FAIL
Created attachment 56771 [details] [review] Bug 16912: Koha::Patrons - Move AddEnrolmentFeeIfNeeded to ->add_enrolment_fee_if_needed This patch moves the code of the C4::Members::AddEnrolmentFeeIfNeeded subroutine to the Koha::Patron->add_enrolment_fee_if_needed method. The behavior should be unchanged. Test plan: 1/ Define enrolment fee for 2 patron categories 2/ Create a patron using the first category => The patron should be charged 3/ Change the patron category to the other one => The patron should be charged again Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 56772 [details] [review] Bug 16912: Koha::Patrons - Move and rewrite tests for AddEnrolmentFeeIfNeeded Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 56773 [details] [review] Bug 16912: Update patron category enrolment fees Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(In reply to Kyle M Hall from comment #23) > Looks like this may need a rebase and a unit test fix up: I got conflicts applying these patches and I cannot recreate the failures. Could you please retest with these patches again? I think I already got these failures with this test file. It looks like random failures caused by existing data and not directly linked with these changes.
Pushed to master for 16.11, thanks Jonathan!
*** Bug 13455 has been marked as a duplicate of this bug. ***