Bugzilla – Attachment 173178 Details for
Bug 38175
Improve bookings behavior with new status field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38175: (QA follow-up) Unit test for filter_by_active change
Bug-38175-QA-follow-up-Unit-test-for-filterbyactiv.patch (text/plain), 3.55 KB, created by
Martin Renvoize (ashimema)
on 2024-10-22 16:31:34 UTC
(
hide
)
Description:
Bug 38175: (QA follow-up) Unit test for filter_by_active change
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-22 16:31:34 UTC
Size:
3.55 KB
patch
obsolete
>From ebf11669c1b2ac3af22805a9a620e961b5d9983b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 22 Oct 2024 17:15:01 +0100 >Subject: [PATCH] Bug 38175: (QA follow-up) Unit test for filter_by_active > change > >We now filter out 'cancelled' and 'completed' bookings in the >filter_by_active method. We need tests for that. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Bookings.t | 46 +++++++++++++++++++++++++++++----- > 1 file changed, 40 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Koha/Bookings.t b/t/db_dependent/Koha/Bookings.t >index 699daaebab5..40b3ce1bcbd 100755 >--- a/t/db_dependent/Koha/Bookings.t >+++ b/t/db_dependent/Koha/Bookings.t >@@ -33,7 +33,7 @@ my $builder = t::lib::TestBuilder->new; > > subtest 'filter_by_active' => sub { > >- plan tests => 5; >+ plan tests => 7; > > $schema->storage->txn_begin; > >@@ -50,7 +50,9 @@ subtest 'filter_by_active' => sub { > value => { > biblio_id => $biblio->biblionumber, > start_date => $start_ago, >- end_date => $end_hour >+ end_date => $end_hour, >+ status => 'new' >+ > } > } > ); >@@ -62,7 +64,9 @@ subtest 'filter_by_active' => sub { > value => { > biblio_id => $biblio->biblionumber, > start_date => $start_ago, >- end_date => $end_ago >+ end_date => $end_ago, >+ status => 'new' >+ > } > } > ); >@@ -74,7 +78,9 @@ subtest 'filter_by_active' => sub { > value => { > biblio_id => $biblio->biblionumber, > start_date => $start_hour, >- end_date => $end_hour >+ end_date => $end_hour, >+ status => 'new' >+ > } > } > ); >@@ -86,7 +92,8 @@ subtest 'filter_by_active' => sub { > value => { > biblio_id => $biblio->biblionumber, > start_date => $start_day, >- end_date => $end_day >+ end_date => $end_day, >+ status => 'new' > } > } > ); >@@ -98,7 +105,8 @@ subtest 'filter_by_active' => sub { > value => { > biblio_id => $biblio->biblionumber, > start_date => $start_day, >- end_date => $end_ago >+ end_date => $end_ago, >+ status => 'new' > } > } > ); >@@ -107,5 +115,31 @@ subtest 'filter_by_active' => sub { > 'EDGE CASE: Booking starting in future, already ended is not counted - should be impossible, but good check' > ); > >+ $builder->build_object( >+ { >+ class => 'Koha::Bookings', >+ value => { >+ biblio_id => $biblio->biblionumber, >+ start_date => $start_day, >+ end_date => $end_day, >+ status => 'cancelled' >+ } >+ } >+ ); >+ is( $biblio->bookings->filter_by_active->count, 3, 'Cancelled bookings are not counted' ); >+ >+ $builder->build_object( >+ { >+ class => 'Koha::Bookings', >+ value => { >+ biblio_id => $biblio->biblionumber, >+ start_date => $start_day, >+ end_date => $end_day, >+ status => 'completed' >+ } >+ } >+ ); >+ is( $biblio->bookings->filter_by_active->count, 3, 'Completed bookings are not counted' ); >+ > $schema->storage->txn_rollback; > }; >-- >2.47.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 38175
:
172770
|
172771
|
172772
|
172773
|
172814
|
172815
|
172816
|
172817
|
172880
|
172881
|
172882
|
172883
|
172884
|
173172
|
173173
|
173174
|
173175
|
173176
|
173177
| 173178 |
173201
|
173202
|
173203
|
173346
|
173915