Bugzilla – Attachment 126992 Details for
Bug 29332
AdditionalContents displays blocks for every library prior to login
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29332: Unit tests
Bug-29332-Unit-tests.patch (text/plain), 1.88 KB, created by
Nick Clemens (kidclamp)
on 2021-10-27 13:14:04 UTC
(
hide
)
Description:
Bug 29332: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-10-27 13:14:04 UTC
Size:
1.88 KB
patch
obsolete
>From 2f78eecb445948414db9073f162ecf9e83352efb Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 27 Oct 2021 12:07:02 +0100 >Subject: [PATCH] Bug 29332: Unit tests > >This patch adds unit tests to ensure we do not leak branch specific >addtional contents blocks outside of logged in sessions (i.e. where a >users branch is not yet set). > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Koha/AdditionalContents.t | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Koha/AdditionalContents.t b/t/db_dependent/Koha/AdditionalContents.t >index ac9f998cb1..bf515b1af1 100755 >--- a/t/db_dependent/Koha/AdditionalContents.t >+++ b/t/db_dependent/Koha/AdditionalContents.t >@@ -157,7 +157,7 @@ subtest '->author' => sub { > > subtest '->search_for_display' => sub { > >- plan tests => 3; >+ plan tests => 4; > > $schema->storage->txn_begin; > >@@ -243,13 +243,17 @@ subtest '->search_for_display' => sub { > }); > > my $news = Koha::AdditionalContents->search_for_display({ location => 'staff_only' }); >- is($news->count, 3, "There are 3 news for staff"); >+ is($news->count, 1, "There is 1 news for all staff"); >+ >+ $news = Koha::AdditionalContents->search_for_display( >+ { location => 'staff_only', library_id => $library1->branchcode } ); >+ is( $news->count, 2, "There are 2 news for staff at library1" ); > > $news = Koha::AdditionalContents->search_for_display({ location => 'opac_only' }); >- is($news->count, 0, "There are 0 news for OPAC"); >+ is($news->count, 0, "There are 0 news for OPAC only"); > > $news = Koha::AdditionalContents->search_for_display({ location => 'staff_and_opac' }); >- is($news->count, 1, "There is 1 news for staff and OPAC"); >+ is($news->count, 1, "There is 1 news for all staff and all OPAC "); > > # TODO We should add more tests here > >-- >2.20.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 29332
:
126960
|
126962
|
126963
|
126991
| 126992 |
126993