Bugzilla – Attachment 170372 Details for
Bug 10190
Overdue notice triggers based on item type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10190: Migrate MarkIssueReturned test to circulation rules
Bug-10190-Migrate-MarkIssueReturned-test-to-circul.patch (text/plain), 4.19 KB, created by
Martin Renvoize (ashimema)
on 2024-08-15 11:37:17 UTC
(
hide
)
Description:
Bug 10190: Migrate MarkIssueReturned test to circulation rules
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-08-15 11:37:17 UTC
Size:
4.19 KB
patch
obsolete
>From 5fdb75db7d7298fe54341cde8de9943fc1f8288e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 15 Aug 2024 09:27:13 +0100 >Subject: [PATCH] Bug 10190: Migrate MarkIssueReturned test to circulation > rules > >Sponsored-by: Glasgow Colleges Library Group >--- > .../Circulation/MarkIssueReturned.t | 65 +++++++++++-------- > 1 file changed, 37 insertions(+), 28 deletions(-) > >diff --git a/t/db_dependent/Circulation/MarkIssueReturned.t b/t/db_dependent/Circulation/MarkIssueReturned.t >index 9c43132a256..c4fdac6f51a 100755 >--- a/t/db_dependent/Circulation/MarkIssueReturned.t >+++ b/t/db_dependent/Circulation/MarkIssueReturned.t >@@ -134,7 +134,8 @@ subtest 'Manually pass a return date' => sub { > my $category = $builder->build_object( { class => 'Koha::Patron::Categories', value => { category_type => 'P', enrolmentfee => 0 } } ); > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $patron = $builder->build_object( >- { class => 'Koha::Patrons', >+ { >+ class => 'Koha::Patrons', > value => { branchcode => $library->branchcode, categorycode => $category->categorycode } > } > ); >@@ -182,21 +183,26 @@ subtest 'AutoRemoveOverduesRestrictions' => sub { > my $categorycode = $patron->categorycode; > my $branchcode = $patron->branchcode; > >- $dbh->do( >- qq{ >- INSERT INTO `overduerules` ( >- `categorycode`, >- `delay1`, >- `letter1`, >- `debarred1`, >- `delay2`, >- `letter2`, >- `debarred2` >- ) >- VALUES ('$categorycode', 6, 'ODUE', 0, 10, 'ODUE2', 1) >- } >+ Koha::CirculationRules->search->delete; >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ itemtype => undef, >+ branchcode => undef, >+ rules => { >+ overdue_1_delay => 6, >+ overdue_1_notice => 'ODUE', >+ overdue_1_mtt => 'email', >+ overdue_1_restrict => 0, >+ overdue_2_delay => 10, >+ overdue_2_notice => 'ODUE2', >+ overdue_2_mtt => 'email', >+ overdue_2_restrict => 1 >+ } >+ } > ); > >+ note("Testing when_no_overdue"); > t::lib::Mocks::mock_preference( 'AutoRemoveOverduesRestrictions', 'when_no_overdue' ); > > t::lib::Mocks::mock_userenv( { branchcode => $branchcode } ); >@@ -230,6 +236,7 @@ subtest 'AutoRemoveOverduesRestrictions' => sub { > $restrictions = $patron->restrictions; > is( $restrictions->count, 0, 'OVERDUES debarment is removed if patron does not have overdues' ); > >+ note("Testing when_no_overdue_causing_debarment"); > t::lib::Mocks::mock_preference( 'AutoRemoveOverduesRestrictions', 'when_no_overdue_causing_debarment' ); > > my $ten_days_ago = dt_from_string->subtract( days => 10 ); >@@ -278,20 +285,22 @@ subtest 'AutoRemoveOverduesRestrictions' => sub { > $checkout_2 = AddIssue( $patron, $item_2->barcode, $eleven_days_ago ); > > # $checkout_1 should now not trigger debarment with this new rule for specific branchcode >- $dbh->do( >- qq{ >- INSERT INTO `overduerules` ( >- `branchcode`, >- `categorycode`, >- `delay1`, >- `letter1`, >- `debarred1`, >- `delay2`, >- `letter2`, >- `debarred2` >- ) >- VALUES ('$branchcode', '$categorycode', 6, 'ODUE', 0, 11, 'ODUE2', 1) >- } >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $categorycode, >+ itemtype => undef, >+ branchcode => $branchcode, >+ rules => { >+ overdue_1_delay => 6, >+ overdue_1_notice => 'ODUE', >+ overdue_1_mtt => 'email', >+ overdue_1_restrict => 0, >+ overdue_2_delay => 11, >+ overdue_2_notice => 'ODUE2', >+ overdue_2_mtt => 'email', >+ overdue_2_restrict => 1 >+ } >+ } > ); > > C4::Circulation::MarkIssueReturned( $patron->borrowernumber, $item_2->itemnumber ); >-- >2.46.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 10190
:
170357
|
170358
|
170359
|
170360
|
170361
|
170362
|
170363
|
170364
|
170365
|
170366
|
170367
|
170368
|
170369
|
170370
|
170371
|
170372
|
170373
|
170374
|
170375
|
170376
|
170380
|
170449
|
171727
|
171728
|
171729
|
171730
|
171731
|
171732
|
171733
|
171734
|
171735
|
171736
|
171737
|
171738
|
171739
|
171740
|
171741
|
171742
|
171743
|
171744
|
171745
|
171746
|
171747
|
171748
|
171749
|
171750
|
171751
|
171752
|
171753
|
171754
|
171755
|
172588
|
172589
|
172590
|
172591
|
172592
|
172593
|
172594
|
172595
|
172596
|
172597
|
172598
|
172599
|
172600
|
172601
|
172602
|
172603
|
172604
|
172605
|
172606
|
172607
|
172608
|
172609
|
172612
|
172614
|
172617
|
172619
|
172621
|
172622
|
172623
|
172624
|
172625
|
172626
|
172630
|
172631
|
172632
|
172633
|
172634
|
172635
|
172636
|
172637
|
172638
|
172639
|
172640
|
172641
|
172642
|
172643
|
172644
|
172645
|
172646
|
172647
|
172648
|
172649
|
172650
|
172651
|
172652
|
172653
|
172654
|
172655
|
172656
|
172657
|
172658
|
172659
|
172660
|
172661
|
172662
|
172663