Koha-clms/t
Tomas Cohen Arazi 809b3308ef Bug 24254: Implement separate filters and add patron param
This patch introduces two new methods for stacking filters on
Koha::Items:

- filter_out_lost
_ filter_out_opachiddenitems

This two filters are what actually happened inside the
filter_by_visible_in_opac. Everything is covered by tests.

In the process I added a Koha::Patron param to the method that is
internally used to decide if the OPACHiddenItems syspref needs to be
honoured or not. This *could* be better done with a fallback to
C4::Context->userenv if no param is passed.

I decided to leave that part for later, if we really find it would help
(e.g. if bug 10589 gets some action and we really need something here to
 handle that).

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit 172747f9ad)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
2021-02-01 21:15:36 +01:00
..
Acquisition
…
Biblio Bug 25709: Rename systempreference to NotesToHide 2020-07-31 03:38:54 +12:00
Budgets Bug 21817: Centralize the mock of userenv from tests 2019-01-02 20:18:29 +00:00
Circulation Bug 24840: [19.11.x] Replace DateTime->now with dt_from_string 2020-05-07 17:17:12 +00:00
External Bug 22010: Check preferences for ebook integration 2019-04-30 11:42:51 +00:00
Koha Bug 25273: Make match-heading rely on authority type configuration 2020-10-20 13:54:22 +13:00
LangInstaller/templates Bug 22007: Generated with add_missing_filters.pl 2019-01-02 20:43:53 +00:00
Members Bug 21015: Remove unecessary 'use Koha::Schema' statements in t/ 2018-11-08 02:18:48 +00:00
Number Bug 18736: (QA follow-up) Change to signed, add large int test 2019-03-21 16:29:06 +00:00
SIP
…
Search Bug 12430: [19.11] Fix buildQuery.t 2020-12-18 21:01:08 +01:00
Serials Bug 24903: Add tests for _handle_seqno 2020-05-04 21:31:16 +00:00
Test
…
db_dependent Bug 24254: Implement separate filters and add patron param 2021-02-01 21:15:36 +01:00
edi_testfiles
…
etc
…
lib Bug 27055: Fix compatibility with newer Firefox+Selenium version 2021-01-13 20:01:51 +01:00
00-checkdatabase-version.t
…
00-deprecated.t
…
00-load.t Bug 21068: Remove NorwegianPatronDB related code 2018-08-30 13:40:29 +00:00
00-merge-conflict-markers.t
…
00-testcritic.t
…
00-valid-xml.t Bug 24494: Make the regex more exact 2020-03-13 00:21:00 +00:00
Auth.t Bug 22943: Remove unused line from Auth.t 2020-04-03 17:30:36 +00:00
AuthUtils.t
…
Auth_with_shibboleth.t Bug 23042: Correct shib param escaping 2019-11-27 11:30:20 +00:00
AuthoritiesMarc_MARC21.t
…
AuthoritiesMarc_UNIMARC.t
…
Barcodes_EAN13.t
…
Barcodes_annual.t
…
Barcodes_hbyymmincr.t
…
Barcodes_incremental.t
…
Biblio.t Bug 11529: (follow-up) Fix QA issues 2019-08-05 15:03:19 +01:00
Biblio2.t Bug 11529: (follow-up) Fix QA issues 2019-08-05 15:03:19 +01:00
Bookseller.t
…
Boolean.t
…
Budgets.t
…
Calendar.t Bug 26000: Make exception_holidays cache with branch in key 2020-08-19 17:32:57 +12:00
Charset.t
…
Circulation_barcodedecode.t Bug 21817: Centralize the mock of userenv from tests 2019-01-02 20:18:29 +00:00
ClassSortRoutine.t
…
ClassSortRoutine_Dewey.t
…
ClassSortRoutine_Generic.t
…
ClassSortRoutine_LCC.t
…
ClassSource.t
…
Context.t Bug 25360: Use secure flag for CGISESSID cookie when using HTTPS 2020-08-25 15:41:41 +12:00
Contract.t
…
Creators.t
…
DateUtils.t Bug 25617: (QA follow-up) Add responses to tests 2020-06-14 21:40:33 +00:00
Debug.t
…
EdiInvoice.t Bug 18267: Refactored Edifact Price Calculations 2020-12-09 21:24:47 +01:00
EdiTransport.t Bug 20254: Add tests for transport ingest 2019-08-20 15:04:26 +01:00
Edifact.t Bug 18267: (QA follow-up) fix typo: overriden => overridden 2020-12-09 21:25:46 +01:00
Ediorder.t Bug 23251: Correct formatting of IMD data ending in apostrophe 2019-07-26 16:23:03 +01:00
Ediordrsp.t
…
Form_MessagingPreferences.t
…
HtmlTags.t
…
Images.t
…
ImportBatch.t
…
Installer_PerlDependencies.t
…
Installer_PerlModules.t
…
Installer_pm.t
…
ItemCirculationAlertPreference.t
…
Koha.t Bug 23768: Adjust the test for invalid ISBN 2019-11-07 13:02:59 +00:00
Koha_Email.t
…
Koha_MetadataRecord.t
…
Koha_Template_Plugin_Cache.t
…
Koha_Template_Plugin_Koha.t
…
Koha_Util_FrameworkPlugin.t
…
Koha_Util_MARC.t
…
Labels.t Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Labels_split_Regex.t Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Labels_split_ccn.t Bug 15836: Fix failing tests 2018-11-13 18:53:10 +00:00
Labels_split_ddcn.t Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Labels_split_lccn.t Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
LangInstaller.t Bug 21895: Fix translation for package install 2018-11-29 17:57:54 +00:00
Languages.t
…
Letters.t
…
Log.t Bug 20750: Add unit tests 2019-03-15 19:07:08 +00:00
Logger.t
…
Makefile.t Bug 20267: .gitignore do not need to be mapped in Makefile 2018-03-26 19:35:07 -03:00
Matcher.t Bug 23324: Add an ISBN normalization routine 2019-08-16 12:26:48 +01:00
Members_AttributeTypes.t
…
Members_Attributes.t
…
Members_Messaging.t
…
OpenLibrarySearch.t
…
Output.t Bug 20422: Add unit test to Output.t for parametrized_url 2018-03-26 17:31:13 -03:00
Output_JSONStream.t
…
Patron.t Bug 14570: Make it possible to add multiple guarantors to a record 2019-08-20 16:04:48 +01:00
Patroncards.t
…
Patroncards_Batch.t
…
Patroncards_Lib.t
…
Patroncards_Patroncard.t
…
Patroncards_Profile.t
…
Patroncards_Template.t
…
Prices.t Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded 2020-09-09 16:41:25 +12:00
Print.t
…
QueryParser.t
…
RecordProcessor.t Bug 25008: Tests for ->options 2020-05-05 20:34:42 +00:00
Ris.t
…
SMS.t
…
Scheduler.t
…
Scrubber.t
…
Search.t
…
Search_PazPar2.t
…
SimpleMARC.t Bug 22571: (follow up) fix Donald cut-&-paste error 2019-06-21 13:13:03 +01:00
SocialData.t
…
Stats.t
…
SuggestionEngine.t
…
SuggestionEngine_AuthorityFile.t
…
TmplToken.t
…
Token.t Bug 21998: Silent tests 2019-03-22 20:21:45 +00:00
XSLT.t
…
dummy.t
…
perlcriticrc
…
template_filters.t Bug 22466: Add tests 2019-03-07 18:17:32 +00:00
timezones.t Bug 18674: TZ error handling 2018-04-11 16:45:08 -03:00