Bugzilla – Attachment 100225 Details for
Bug 23112
Add circulation process to inter-library loans
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23112: (follow-up) Unit test fixes
Bug-23112-follow-up-Unit-test-fixes.patch (text/plain), 5.96 KB, created by
Andrew Isherwood
on 2020-03-06 09:37:09 UTC
(
hide
)
Description:
Bug 23112: (follow-up) Unit test fixes
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2020-03-06 09:37:09 UTC
Size:
5.96 KB
patch
obsolete
>From 5216866884b15291694c920a219cf779dd295cbf Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Fri, 6 Mar 2020 09:33:16 +0000 >Subject: [PATCH] Bug 23112: (follow-up) Unit test fixes > >As requested by Nick, fixes unit tests and added a test for the new >Koha::Illrequest::biblio method >--- > t/db_dependent/Illrequests.t | 62 ++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 51 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t >index 2b24e92a64..41b4bf7600 100644 >--- a/t/db_dependent/Illrequests.t >+++ b/t/db_dependent/Illrequests.t >@@ -33,6 +33,7 @@ use t::lib::TestBuilder; > use Test::MockObject; > use Test::MockModule; > use Test::Exception; >+use Test::Deep qw/ cmp_deeply ignore /; > > use Test::More tests => 12; > >@@ -120,7 +121,7 @@ subtest 'Basic object tests' => sub { > > subtest 'Working with related objects' => sub { > >- plan tests => 5; >+ plan tests => 7; > > $schema->storage->txn_begin; > >@@ -161,6 +162,16 @@ subtest 'Working with related objects' => sub { > is($illrq_obj->illrequestattributes->count + 1, Koha::Illrequestattributes->search->count, > "Fetching expected number of Illrequestattributes for our request."); > >+ is($illrq_obj->biblio, undef, "->biblio returns undef if no biblio"); >+ my $biblio = $builder->build_object({ class => 'Koha::Biblios' }); >+ my $req_bib = $builder->build_object({ >+ class => 'Koha::Illrequests', >+ value => { >+ biblio_id => $biblio->biblionumber >+ } >+ }); >+ isa_ok($req_bib->biblio, 'Koha::Biblio', "OK accessing related biblio"); >+ > $illrq_obj->delete; > is(Koha::Illrequestattributes->search->count, 1, > "Correct number of illrequestattributes after delete."); >@@ -244,8 +255,13 @@ subtest 'Status Graph tests' => sub { > # Compare the updated graph to the expected graph > # The structure we compare against here is just a copy of the structure found > # in Koha::Illrequest::_core_status_graph() + the new node we created above >- is_deeply( $new_graph, >+ cmp_deeply( $new_graph, > { >+ TEST => { >+ prev_actions => [ ], >+ id => 'TEST', >+ next_actions => [ ], >+ }, > NEW => { > prev_actions => [ ], # Actions containing buttons > # leading to this status >@@ -264,7 +280,7 @@ subtest 'Status Graph tests' => sub { > name => 'Requested', > ui_method_name => 'Confirm request', > method => 'confirm', >- next_actions => [ 'REQREV', 'COMP' ], >+ next_actions => [ 'REQREV', 'COMP', 'CHK' ], > ui_method_icon => 'fa-check', > }, > GENREQ => { >@@ -273,7 +289,7 @@ subtest 'Status Graph tests' => sub { > name => 'Requested from partners', > ui_method_name => 'Place request with partners', > method => 'generic_confirm', >- next_actions => [ 'COMP' ], >+ next_actions => [ 'COMP', 'CHK' ], > ui_method_icon => 'fa-send-o', > }, > REQREV => { >@@ -285,11 +301,6 @@ subtest 'Status Graph tests' => sub { > next_actions => [ 'REQ', 'GENREQ', 'KILL' ], > ui_method_icon => 'fa-times', > }, >- TEST => { >- prev_actions => [ ], >- id => 'TEST', >- next_actions => [ ], >- }, > QUEUED => { > prev_actions => [ ], > id => 'QUEUED', >@@ -314,7 +325,7 @@ subtest 'Status Graph tests' => sub { > name => 'Completed', > ui_method_name => 'Mark completed', > method => 'mark_completed', >- next_actions => [ ], >+ next_actions => [ 'CHK' ], > ui_method_icon => 'fa-check', > }, > KILL => { >@@ -326,6 +337,27 @@ subtest 'Status Graph tests' => sub { > next_actions => [ ], > ui_method_icon => 'fa-trash', > }, >+ CHK => { >+ prev_actions => [ 'REQ', 'GENREQ', 'COMP' ], >+ id => 'CHK', >+ name => 'Checked out', >+ ui_method_name => 'Check out', >+ needs_prefs => [ 'CirculateILL' ], >+ needs_perms => [ 'user_circulate_circulate_remaining_permissions' ], >+ needs_all => ignore(), >+ method => 'check_out', >+ next_actions => [ ], >+ ui_method_icon => 'fa-upload', >+ }, >+ RET => { >+ prev_actions => [ 'CHK' ], >+ id => 'RET', >+ name => 'Returned to library', >+ ui_method_name => 'Check in', >+ method => 'check_in', >+ next_actions => [ 'COMP' ], >+ ui_method_icon => 'fa-download', >+ } > }, > "new node + core_status_graph = bigger status graph" > ) || diag explain $new_graph; >@@ -782,7 +814,12 @@ subtest 'Checking out' => sub { > > $schema->storage->txn_begin; > >- my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' }); >+ my $itemtype = $builder->build_object({ >+ class => 'Koha::ItemTypes', >+ value => { >+ notforloan => 1 >+ } >+ }); > my $library = $builder->build_object({ class => 'Koha::Libraries' }); > my $biblio = $builder->build_object({ class => 'Koha::Biblios' }); > my $patron = $builder->build_object({ >@@ -851,6 +888,9 @@ subtest 'Checking out' => sub { > > # Passed validation > # >+ # We need to mock the user environment for AddIssue >+ t::lib::Mocks::mock_userenv({ branchcode => $library->{branchcode} }); >+ # > # Delete the items we created, so we can test that we can create one > Koha::Items->find({ itemnumber => $item1->itemnumber })->delete; > Koha::Items->find({ itemnumber => $item2->itemnumber })->delete; >-- >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 23112
:
91987
|
91988
|
91989
|
91990
|
91991
|
92000
|
92001
|
92002
|
92003
|
92004
|
93530
|
93531
|
93532
|
93533
|
93534
|
93958
|
94264
|
94265
|
94266
|
94267
|
94268
|
94269
|
95565
|
95566
|
95567
|
95568
|
95569
|
95570
|
96834
|
96870
|
99910
|
99911
|
99912
|
99913
|
99914
|
99915
|
99916
|
99917
|
100100
|
100101
|
100102
|
100103
|
100104
|
100105
|
100106
|
100107
|
100108
|
100169
|
100224
|
100225
|
100252
|
100253
|
100254
|
100255
|
100256
|
100257
|
100258
|
100259
|
100260
|
100261
|
100262
|
100263