Bugzilla – Attachment 95928 Details for
Bug 24144
regressions.t tests have not been updated after bug 23836
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24144: (bug 23836 follow-up) Fix regressions.t tests
Bug-24144-bug-23836-follow-up-Fix-regressionst-tes.patch (text/plain), 3.04 KB, created by
Jonathan Druart
on 2019-12-02 16:13:58 UTC
(
hide
)
Description:
Bug 24144: (bug 23836 follow-up) Fix regressions.t tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-12-02 16:13:58 UTC
Size:
3.04 KB
patch
obsolete
>From 34197c8de76729d734dc5f554e09dd6ccf17c411 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 2 Dec 2019 17:12:06 +0100 >Subject: [PATCH] Bug 24144: (bug 23836 follow-up) Fix regressions.t tests > >Bug 24144 changes the behavior for tracklinks.pl but did not adjust the >tests. > >We must then expect 404 if the pref is turned off. >Also mock_preference cannot work (we are hitting the web server and so >need to set the value in DB and flush the L1 caches) >--- > t/db_dependent/www/regressions.t | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/www/regressions.t b/t/db_dependent/www/regressions.t >index 521a1204aa..9ea1a1d96a 100644 >--- a/t/db_dependent/www/regressions.t >+++ b/t/db_dependent/www/regressions.t >@@ -26,6 +26,7 @@ use C4::Context; > use C4::Biblio; > > use Koha::Database; >+use Koha::Caches; > > use MARC::Field; > >@@ -94,23 +95,24 @@ subtest 'open redirection vulnerabilities in tracklinks' => sub { > '/cgi-bin/koha/tracklinks.pl?uri=http://www.google.com&itemnumber=' > . $itemnumber1; > >+ Koha::Caches->flush_L1_caches; > # Don't Track >- t::lib::Mocks::mock_preference( 'TrackClicks', '' ); >+ C4::Context->set_preference( 'TrackClicks', '' ); > $t->get_ok( $opac . $no_biblionumber ) > ->status_is( 404, "404 for no biblionumber" ); > $t->get_ok( $opac . $bad_biblionumber1 ) >- ->status_is( 404, "404 for biblionumber containing no URI" ); >+ ->status_is( 404, "404 for biblionumber containing no URI - pref off" ); > $t->get_ok( $opac . $bad_biblionumber2 ) >- ->status_is( 404, "404 for biblionumber containing different URI" ); >+ ->status_is( 404, "404 for biblionumber containing different URI - pref off" ); > $t->get_ok( $opac . $good_biblionumber ) >- ->status_is( 302, "302 for biblionumber with matching URI" ); >+ ->status_is( 404, "404 for biblionumber with matching URI - pref off" ); > $t->get_ok( $opac . $bad_itemnumber ) >- ->status_is( 404, "404 for itemnumber containing different URI" ); >+ ->status_is( 404, "404 for itemnumber containing different URI- pref off" ); > $t->get_ok( $opac . $good_itemnumber ) >- ->status_is( 302, "302 for itemnumber with matching URI" ); >+ ->status_is( 404, "404 for itemnumber with matching URI - pref off" ); > > # Track >- t::lib::Mocks::mock_preference( 'TrackClicks', 'track' ); >+ C4::Context->set_preference( 'TrackClicks', 'track' ); > $t->get_ok( $opac . $no_biblionumber ) > ->status_is( 404, "404 for no biblionumber" ); > $t->get_ok( $opac . $bad_biblionumber1 ) >@@ -125,7 +127,7 @@ subtest 'open redirection vulnerabilities in tracklinks' => sub { > ->status_is( 302, "302 for itemnumber with matching URI" ); > > # Track Anonymous >- t::lib::Mocks::mock_preference( 'TrackClicks', 'anonymous' ); >+ C4::Context->set_preference( 'TrackClicks', 'anonymous' ); > $t->get_ok( $opac . $no_biblionumber ) > ->status_is( 404, "404 for no biblionumber" ); > $t->get_ok( $opac . $bad_biblionumber1 ) >-- >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 24144
:
95928
|
95929