Koha/t/db_dependent
Tomas Cohen Arazi a592ebb3bb Bug 24254: Compare itemlost with 0
On C4::Search and C4::Circulation the uses of the items.itemlost field
highlight the fact that the comparisson itemlost <= 0 was wrong, as it
is evaluated as a Perl boolean.

The column can only be an int and NOT NULL, so we need to check if it is
0 to ponder if not hidden.

This patch changes the tests to reflect this, and adjust the
Koha::Items->filter_by_visible_in_opac implementation to adapt to this.

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: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-01-14 14:03:49 +01:00
..
Acquisition Bug 26584: Remove unused C4::Acquisition::CloseBasket function 2020-11-05 15:24:20 +01:00
api/v1 Bug 27015: Unit tests 2021-01-04 16:33:15 +01:00
Auth Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Authority Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Biblio Bug 25306: Remove framework paramter from ModBiblioMarc 2021-01-12 16:13:50 +01:00
Circulation Bug 21301: (QA follow-up) Fix number of tests 2021-01-12 11:17:33 +01:00
CourseReserves Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Creators Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
cronjobs Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
data Bug 11677: Use zebra not-onloan-count index for availability limit 2019-08-20 15:00:16 +01:00
Exporter
Holds
Illrequest Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Items Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Koha Bug 24254: Compare itemlost with 0 2021-01-14 14:03:49 +01:00
Labels Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
LDAP
Letters Bug 26745: (QA follow-up) Add Unit Tests 2020-11-04 17:32:35 +01:00
Members Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
misc/translator Bug 25067: Adjust paths in tests 2020-11-06 16:59:40 +01:00
OAI Bug 25460: Add unit test for change to C4::OAI::Sets->UpdateOAISetsBiblio() 2020-10-15 12:56:31 +02:00
Patron Bug 26594: add Unit Test 2020-11-10 15:00:14 +01:00
Record Bug 25898: Fix new occurrences 2020-10-15 13:56:41 +02:00
Reports
Reserves Bug 26634: Remove GetHoldRule subroutine in C4::Reserves 2020-12-21 10:07:38 +01:00
Search Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
selenium Bug 26847: (follow-up) fix get_attribute() call 2021-01-05 14:40:26 +01:00
Serials
SIP Bug 26950: Fix SIP/Message.t 2021-01-13 17:15:15 +01:00
Template/Plugin Bug 26984: Make tests pass if AnonymousPatron is set 2020-11-20 08:16:02 +01:00
Utils
www Bug 26031: Remove the failing tests and the diag 2020-11-20 08:16:02 +01:00
00-strict.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
01-test_dbic.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Accounts.t Bug 26984: Make tests pass if AnonymousPatron is set 2020-11-20 08:16:02 +01:00
Acquisition.t Bug 26584: Remove unused C4::Acquisition::CloseBasket function 2020-11-05 15:24:20 +01:00
Amazon.t
ArticleRequests.t
AudioAlerts.t Bug 22001: Remove the RaiseError occurrences from tests 2020-03-27 08:52:56 +00:00
Auth.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Auth_with_cas.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Auth_with_ldap.t
AuthorisedValues.t
AuthoritiesMarc.t Bug 25313: (QA follow-up) DelAuthority tests 2020-11-18 12:03:03 +01:00
AuthUtils.t
BackgroundJob.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Barcodes.t Bug 26250: Fix tests when SearchEngine=Elastic 2020-08-31 16:10:26 +02:00
Barcodes_ValueBuilder.t
Biblio.t Bug 26518: (QA follow-up) Expect warnings, don't supress them 2020-11-25 15:18:17 +01:00
Breeding.t Bug 24052: Fix Koha/XSLT/Base.t 2020-03-24 10:42:23 +00:00
Budgets.t Bug 26250: Fix tests when SearchEngine=Elastic 2020-08-31 16:10:26 +02:00
Cache.t Bug 16067: Remove FastMmap 2020-12-04 15:40:58 +01:00
Calendar.t
Charset.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
check_kohastructure.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
check_sysprefs.t Bug 23895: Fix check_sysprefs.t 2020-10-14 15:52:29 +02:00
Circulation.t Bug 26593: Remove _get_discount_from_rule 2021-01-12 11:17:37 +01:00
Clubs.t
Context.t Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Contract.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
CourseReserves.t
db_structure.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
DecreaseLoanHighHolds.t Bug 14866: Make high holds work with different item types 2020-11-06 15:55:17 +01:00
Filter_MARC_ViewPolicy.t
Fines.t
FrameworkPlugin.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Heading.t Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
Heading_MARC21.t Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
Hold.t Bug 12556: Add new "in processing" state to holds 2020-10-14 14:50:07 +02:00
Holds.t Bug 26634: Remove GetHoldRule subroutine in C4::Reserves 2020-12-21 10:07:38 +01:00
HoldsQueue.t Bug 26367: Unit test 2021-01-07 15:37:15 +01:00
Holidays.t Bug 25723: Remove tests for removed method 2020-07-20 17:45:31 +02:00
Illcomments.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Illrequestattributes.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Illrequests.t Bug 22818: Fix TestBuilder.t 2020-11-11 18:03:17 +01:00
ILSDI_Services.t Bug 21301: add unit tests 2021-01-12 11:17:33 +01:00
ImportBatch.t Bug 23019: Add tests 2020-11-11 15:55:49 +01:00
ImportExportFramework.t
Installer.t
Items.t Bug 26032: Add unit test 2020-11-04 12:59:32 +01:00
Koha.t
Koha_Authority.t Bug 15578: Insert authority records before processing tests 2016-01-23 18:28:49 +00:00
Koha_Database.t
Koha_Elasticsearch.t
Koha_ExternalContent_OverDrive.t
Koha_ExternalContent_RecordedBooks.t
Koha_Misc_Files.t Bug 22001: Remove the RaiseError occurrences from tests 2020-03-27 08:52:56 +00:00
Languages.t
Letters.t Bug 26922: Regression tests 2020-11-20 15:44:20 +01:00
LibraryGroups.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Linker_Default.t
Linker_FirstMatch.t Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
Log.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
MarcModificationTemplates.t Bug 26894: Handle subfield 0 and delete empty fields 2021-01-12 16:02:35 +01:00
Members.t Bug 14708: Skip AnonymousPatron in GetBorrowersToExpunge 2020-11-06 09:40:25 +01:00
MungeMarcPrice.t Bug 14334: Remove AutoCommit from tests 2018-12-14 13:42:37 +00:00
NewsChannels.t
Overdues.t Bug 27079: Unit tests 2020-11-27 09:37:10 +01:00
Passwordrecovery.t Bug 22343: (follow-up) Remove traces of Mail::Sendmail 2020-10-05 11:15:51 +02:00
Patroncards.t Bug 22878: Add tests 2019-05-15 12:10:52 +00:00
PatronLists.t Bug 21817: Centralize the mock of userenv from tests 2019-01-02 20:18:29 +00:00
Patrons.t Bug 25683: Patron with no accountlines should have 0 outstanding (not NULL) 2020-08-06 11:37:06 +02:00
Record.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
RecordProcessor_EmbedSeeFromHeadings.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Reports.t Bug 5327: Shifting a db dependent test to the right place 2012-02-01 18:15:19 +01:00
Reserves.t Bug 27012: Add test for C4::Reserves::MergeHolds 2020-11-16 13:45:07 +01:00
rollingloans.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
RotatingCollections.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Search.t Bug 26957: Unit tests 2021-01-12 16:02:35 +01:00
Serials.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Serials_2.t
Service.t
ShelfBrowser.t
Sitemapper.t
Stats.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
StockRotationItems.t Bug 23432: (QA follow-up) Add a unit test 2020-10-26 00:04:18 +01:00
StockRotationRotas.t
StockRotationStages.t
SuggestionEngine_ExplodedTerms.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Suggestions.t
sysprefs.t Bug 22880: (follow-up) Loose ends: Better DB update, global inclusion, etc. 2020-02-24 13:24:25 +00:00
TablesSettings.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Tags.t
Templates.t
TestBuilder.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Upload.t
UsageStats.t Bug 23420: (QA follow-up) Remove more AllowPurchaseSuggestionBranchChoice code 2020-10-09 12:22:01 +02:00
Virtualshelves.t
XISBN.t Bug 26364: Adjust unit tests 2021-01-07 15:37:15 +01:00
XSLT.t
zebra_config.pl Bug 24735: Remove QueryParser-related code 2020-03-02 11:13:03 +00:00