Bug 14598: (regression tests) AddReturn should store itemtype on 'statistics' table
authorTomas Cohen Arazi <tomascohen@theke.io>
Sun, 26 Jul 2015 05:05:16 +0000 (02:05 -0300)
committerJulian Maurice <julian.maurice@biblibre.com>
Wed, 30 Nov 2016 12:48:04 +0000 (13:48 +0100)
commit465e1a203fc398a232a4ba79caebb9003e3266af
tree1d250418a62183295e5442212911c43228ea8762
parent497e28039f392276a4415c49192fb73110ba6642
Bug 14598: (regression tests) AddReturn should store itemtype on 'statistics' table

This patch adds tests for C4::Circulation::AddReturn(). Both tests are wrapped
inside a subtest, and look for AddReturn storing the right itemtype on the
'statistics' table.

Note: It also refactors the file a bit, to avoid side effects. And uses TestBuilder
to make it independent on already-present db data. It also removes warnings by mocking
C4::Context::userenv

To test:
- Apply the patch
- Run the tests:
  $ prove t/db_dependent/Circulation/Returns.t
=> FAIL: Tests fail bacause AddReturn is not storing the itemtype
- Sign off :-D

Sponsored-by: Universidad Empresarial Siglo 21
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 357a69b0e174c813ef52d1ee7f47cd810c76938d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
t/db_dependent/Circulation/Returns.t