Bugzilla – Attachment 178821 Details for
Bug 39214
Mock preferences in t/db_dependent/Koha/Session.t for subtest 'test session driver'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39214: Mock preferences in t/db_dependent/Koha/Session.t for subtest 'test session driver'
Bug-39214-Mock-preferences-in-tdbdependentKohaSess.patch (text/plain), 1.86 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-02-28 13:31:32 UTC
(
hide
)
Description:
Bug 39214: Mock preferences in t/db_dependent/Koha/Session.t for subtest 'test session driver'
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-02-28 13:31:32 UTC
Size:
1.86 KB
patch
obsolete
>From 4abe8d9ddf06c7f244dd3610acc56ba9dc236022 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 28 Feb 2025 05:58:08 -0500 >Subject: [PATCH] Bug 39214: Mock preferences in t/db_dependent/Koha/Session.t > for subtest 'test session driver' > >The "test session driver" unit test assume SessionStorage is set to MySQL and will fail if it is set to anything else. We should mock the values, and test the other supported values. > >Test Plan: >1) Set SessionStorage to File >2) prove t/db_dependent/Koha/Session.t >3) Note test failure >4) prove t/db_dependent/Koha/Session.t >5) Tests pass! > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Session.t | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Session.t b/t/db_dependent/Koha/Session.t >index e9cce064c3f..237d0c1314d 100755 >--- a/t/db_dependent/Koha/Session.t >+++ b/t/db_dependent/Koha/Session.t >@@ -4,6 +4,7 @@ use Modern::Perl; > use Test::More tests => 2; > > use t::lib::TestBuilder; >+use t::lib::Mocks; > use C4::Auth; > use Koha::Session; > >@@ -29,8 +30,17 @@ subtest 'basic session fetch' => sub { > }; > > subtest 'test session driver' => sub { >- plan tests => 1; >+ plan tests => 3; > >+ t::lib::Mocks::mock_preference( 'SessionStorage', 'mysql' ); > my $params = Koha::Session->_get_session_params(); > is( $params->{dsn}, 'serializer:yamlxs;driver:MySQL;id:md5', 'dsn setup correctly' ); >+ >+ t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); >+ $params = Koha::Session->_get_session_params(); >+ is( $params->{dsn}, 'serializer:yamlxs;driver:File;id:md5', 'dsn setup correctly' ); >+ >+ t::lib::Mocks::mock_preference( 'SessionStorage', 'memcached' ); >+ $params = Koha::Session->_get_session_params(); >+ is( $params->{dsn}, 'serializer:yamlxs;driver:memcached;id:md5', 'dsn setup correctly' ); > }; >-- >2.48.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 39214
:
178816
| 178821