Bugzilla – Attachment 105581 Details for
Bug 24003
REST API should set C4::Context->userenv
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24003: (follow-up) Basic auth missing tests for stashed user
Bug-24003-follow-up-Basic-auth-missing-tests-for-s.patch (text/plain), 1.52 KB, created by
Tomás Cohen Arazi
on 2020-06-05 12:28:34 UTC
(
hide
)
Description:
Bug 24003: (follow-up) Basic auth missing tests for stashed user
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2020-06-05 12:28:34 UTC
Size:
1.52 KB
patch
obsolete
>From 4958ace4d5e4fa73a6575a524f54452ba95ca04d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 5 Jun 2020 09:26:08 -0300 >Subject: [PATCH] Bug 24003: (follow-up) Basic auth missing tests for stashed > user > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/auth_basic.t | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/auth_basic.t b/t/db_dependent/api/v1/auth_basic.t >index 1073bfd0bb0..99b81159dac 100644 >--- a/t/db_dependent/api/v1/auth_basic.t >+++ b/t/db_dependent/api/v1/auth_basic.t >@@ -30,7 +30,7 @@ my $t = Test::Mojo->new('Koha::REST::V1'); > > subtest 'success tests' => sub { > >- plan tests => 6; >+ plan tests => 9; > > $schema->storage->txn_begin; > >@@ -52,10 +52,18 @@ subtest 'success tests' => sub { > ); > }); > >+ my $stash; >+ $t->app->hook(after_dispatch => sub { $stash = shift->stash }); >+ > $t->get_ok("//$userid:$password@/api/v1/patrons") > ->status_is( 200, 'Successful authentication and permissions check' ) > ->json_is('/userenv/number' => $patron->borrowernumber ); > >+ my $user = $stash->{'koha.user'}; >+ ok( defined $user, 'The \'koha.user\' object is defined in the stash') and >+ is( ref($user), 'Koha::Patron', 'Stashed koha.user object type is Koha::Patron') and >+ is( $user->borrowernumber, $patron->borrowernumber, 'The stashed user is the right one' ); >+ > $patron->flags(undef)->store; > > $t->get_ok("//$userid:$password@/api/v1/patrons") >-- >2.27.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 24003
:
95228
|
95230
|
105579
|
105580
|
105581
|
105586
|
105587
|
105588
|
105633
|
105634
|
105635
|
105666
|
105844
|
105845
|
105846
|
105847
|
106087
|
106088
|
106089
|
106090