Bugzilla – Attachment 86504 Details for
Bug 18589
Show ILLs as part of patron profile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18589: (follow-up) Add borrowernumber test
Bug-18589-follow-up-Add-borrowernumber-test.patch (text/plain), 3.29 KB, created by
Andrew Isherwood
on 2019-03-12 09:21:13 UTC
(
hide
)
Description:
Bug 18589: (follow-up) Add borrowernumber test
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2019-03-12 09:21:13 UTC
Size:
3.29 KB
patch
obsolete
>From c823eb4aef93c85c4c2d1b500eec0fb752b8699e Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Tue, 12 Mar 2019 09:19:56 +0000 >Subject: [PATCH] Bug 18589: (follow-up) Add borrowernumber test > >As per comment #21: >https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18589#c21 > >We now test borrowernumber filter works. This test has come from >https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83184&action=diff >and will be removed from that bug >--- > t/db_dependent/api/v1/illrequests.t | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/api/v1/illrequests.t b/t/db_dependent/api/v1/illrequests.t >index a0028810e6..fefb96dea9 100644 >--- a/t/db_dependent/api/v1/illrequests.t >+++ b/t/db_dependent/api/v1/illrequests.t >@@ -40,7 +40,7 @@ my $t = Test::Mojo->new('Koha::REST::V1'); > > subtest 'list() tests' => sub { > >- plan tests => 21; >+ plan tests => 24; > > # Mock ILLBackend (as object) > my $backend = Test::MockObject->new; >@@ -81,7 +81,8 @@ subtest 'list() tests' => sub { > $t->request_ok($tx)->status_is(200)->json_is( [] ); > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >- my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron_2 = $builder->build_object( { class => 'Koha::Patrons' } ); > > # Create an ILL request > my $illrequest = $builder->build_object( >@@ -90,7 +91,7 @@ subtest 'list() tests' => sub { > value => { > backend => 'Mock', > branchcode => $library->branchcode, >- borrowernumber => $patron->borrowernumber >+ borrowernumber => $patron_1->borrowernumber > } > } > ); >@@ -114,7 +115,7 @@ subtest 'list() tests' => sub { > $tx->req->env( { REMOTE_ADDR => $remote_address } ); > $t->request_ok($tx)->status_is(200) > ->json_has( '/0/patron', 'patron embedded' ) >- ->json_is( '/0/patron/patron_id', $patron->borrowernumber, 'The right patron is embeded') >+ ->json_is( '/0/patron/patron_id', $patron_1->borrowernumber, 'The right patron is embeded') > ->json_has( '/0/requested_partners', 'requested_partners embedded' ) > ->json_has( '/0/capabilities', 'capabilities embedded' ) > ->json_has( '/0/library', 'library embedded' ) >@@ -128,7 +129,7 @@ subtest 'list() tests' => sub { > value => { > backend => 'Mock', > branchcode => $library->branchcode, >- borrowernumber => $patron->borrowernumber >+ borrowernumber => $patron_2->borrowernumber > } > } > ); >@@ -154,6 +155,13 @@ subtest 'list() tests' => sub { > [{ path => '/query/request_blah', message => 'Malformed query string'}] > ); > >+ # Test the borrowernumber parameter >+ $tx = $t->ua->build_tx( GET => '/api/v1/illrequests?borrowernumber=' . >+ $patron_2->borrowernumber ); >+ $tx->req->cookies( { name => 'CGISESSID', value => $session_id } ); >+ $tx->req->env( { REMOTE_ADDR => $remote_address } ); >+ $t->request_ok($tx)->status_is(200)->json_is( [ $response2 ] ); >+ > $schema->storage->txn_rollback; > }; > >-- >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 18589
:
74809
|
79692
|
82177
|
82513
|
84197
|
84199
|
84204
|
84792
|
84796
|
86432
|
86433
|
86456
|
86465
|
86504
|
86506
|
86507
|
86714
|
86715
|
86716
|
86717
|
86718
|
86719
|
86720
|
86721
|
86722
|
86735
|
86736
|
86737