Bug 12264 - Tiny typo in t/db_dependent/Items.t
Summary: Tiny typo in t/db_dependent/Items.t
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Katrin Fischer
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-15 12:34 UTC by Magnus Enger
Modified: 2015-06-04 23:33 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12264: Correct tiny typo in t/db_dependent/Items.t (1.29 KB, patch)
2014-11-09 22:01 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 12264: Correct tiny typo in t/db_dependent/Items.t (1.35 KB, patch)
2014-11-10 05:42 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 12264: Correct tiny typo in t/db_dependent/Items.t (1.45 KB, patch)
2014-11-10 08:33 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 12264: [QA Follow-up] Fixing biblionumber/biblioitemnumber mixup (1.61 KB, patch)
2014-11-10 08:33 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2014-05-15 12:34:16 UTC
t/db_dependent/Items.t has these lines:

172     $schema->resultset('Systempreference')->update_or_create({ variable => 'item-level_itypes', value => 0 });
173     ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' );
174
175     $schema->resultset('Systempreference')->update_or_create({ variable => 'item-level_itypes', value => 1 });
176     ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is disabled' );

I believe the last line should be "...when item-level_itypes is enabled". No practical impact, but it might be confusing to someone at some time.
Comment 1 Katrin Fischer 2014-11-09 22:01:57 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-11-10 05:42:02 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2014-11-10 08:33:01 UTC
Created attachment 33408 [details] [review]
Bug 12264: Correct tiny typo in t/db_dependent/Items.t

One of the tests claims 'item-level_itypes is disabled'
when it should be 'item-level_itypes is enabled'.

Patch fixes this.

To test:
- run t/db_dependent/Items.t
- tests should all pass
- verify the last test reads 'enabled'
- look at the code and see it's true

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2014-11-10 08:33:04 UTC
Created attachment 33409 [details] [review]
Bug 12264: [QA Follow-up] Fixing biblionumber/biblioitemnumber mixup

While testing the string change on 12264, I had this result:
DBD::mysql::st execute failed: Column 'biblioitemnumber' cannot be null at /usr/share/koha/testclone/C4/Items.pm line 2191.
DBD::mysql::st execute failed: Column 'biblioitemnumber' cannot be null at /usr/share/koha/testclone/C4/Items.pm line 2191.
    # Child (GetItemsInfo tests) exited without calling finalize()
not ok 4 - GetItemsInfo tests

This was caused by this line in the unit test:
 my $biblionumber = get_biblio();
This routine returns:
    return ($bibnum, $bibitemnum);
So instead of the bibnum the bibitemnum is saved in biblionumber.
In my test database bibnum and bibitemnum somehow got out of sync, revealing
this bug :)
The fix is just adding parentheses:
 my ( $biblionumber ) = get_biblio();

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Tomás Cohen Arazi 2014-11-10 15:03:36 UTC
Patches pushed to master.

Thanks Katrin and Marcel!