Bugzilla – Attachment 143296 Details for
Bug 31907
Show items as On hold when in processing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31907: (QA follow-up) Simplify tests
Bug-31907-QA-follow-up-Simplify-tests.patch (text/plain), 2.89 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-11-04 23:19:26 UTC
(
hide
)
Description:
Bug 31907: (QA follow-up) Simplify tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-11-04 23:19:26 UTC
Size:
2.89 KB
patch
obsolete
>From bc7f1c820e0627ff3c20735635118151c7672ea1 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 4 Nov 2022 20:17:08 -0300 >Subject: [PATCH] Bug 31907: (QA follow-up) Simplify tests > >This patch simplipfies the tests, and highlighs the fact the introduced >method should add filters to the current resultset. > >It also aligns the tests with the currently adopted style. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Holds.t | 39 ++++++++++++------------------------- > 1 file changed, 12 insertions(+), 27 deletions(-) > >diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t >index 5e055307ffc..5a86d76261f 100755 >--- a/t/db_dependent/Koha/Holds.t >+++ b/t/db_dependent/Koha/Holds.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 9; >+use Test::More tests => 10; > use Test::Warn; > > use C4::Circulation qw( AddIssue ); >@@ -745,52 +745,37 @@ subtest 'filter_by_has_cancellation_requests() and filter_out_has_cancellation_r > $schema->storage->txn_rollback; > }; > >-subtest 'get holds in processing' => sub { >+subtest 'processing() tests' => sub { > >- plan tests => 1; >+ plan tests => 3; > > $schema->storage->txn_begin; > >- my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >- >- my $item = $builder->build_sample_item; >- > my $hold_1 = $builder->build_object( > { > class => 'Koha::Holds', >- value => { >- found => 'P', >- itemnumber => $item->id, >- biblionumber => $item->biblionumber, >- borrowernumber => $patron->id >- } >+ value => { found => 'P' } > } > ); > my $hold_2 = $builder->build_object( > { > class => 'Koha::Holds', >- value => { >- found => undef, >- itemnumber => $item->id, >- biblionumber => $item->biblionumber, >- borrowernumber => $patron->id >- } >+ value => { found => undef } > } > ); > my $hold_3 = $builder->build_object( > { > class => 'Koha::Holds', >- value => { >- found => undef, >- itemnumber => $item->id, >- biblionumber => $item->biblionumber, >- borrowernumber => $patron->id >- } >+ value => { found => 'T' } > } > ); > >- my $processing_holds = $item->holds->processing; >- is( $processing_holds->count, 1 ); >+ my $holds = Koha::Holds->search({ reserve_id => [ $hold_1->id, $hold_2->id, $hold_3->id ] }); >+ is( $holds->count, 3, 'Resultset contains 3 holds' ); >+ >+ my $processing = $holds->processing; >+ is( $processing->count, 1 ); >+ is( $processing->next->id, $hold_1->id, "First hold is the only one in 'processing'" ); > > $schema->storage->txn_rollback; > }; >-- >2.34.1
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 31907
:
142339
|
142567
|
142821
|
143018
|
143019
| 143296