Bug 14346: t/Biblio.t fails because of new warning
authorTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 5 Jun 2015 17:52:36 +0000 (14:52 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Sun, 7 Jun 2015 21:37:32 +0000 (18:37 -0300)
commit46419b797bfb53bfbff6f8f83c5e016859ac48fa
tree15c8024fde0f407311cbb287be92ab764d01e77c
parent5a02cf9b48685d3b71397f86a862b2d7535a68b6
Bug 14346: t/Biblio.t fails because of new warning

Running

 $ prove t/Biblio.t

fails because of us now using DBIx to retrieve sysprefs. Then our mocked DBI is not "supported" by DBIx hence a warning that makes our test fail (there is one more warning now).

The cool thing about this, is that it actually helped spot a situation where GetMarcBiblio is doing wrong things because is not checking its parameters are undefined, so we have the chance to fix it.

This patch makes GetMarcBiblio return undef if no biblionumber is passed, and
also raises a conveniently carped warning. This change is tested in t/Biblio.t with new tests.

To test:
- In current master, run
  $ prove t/Biblio.t
=> FAIL: a test detects a wrong warning count and fails.
- Apply the patch and run
  $ prove t/Biblio.t
=> SUCCESS: Tests now pass, and there are 2 new ones.
- Sign off :-D

Regards

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Biblio.pm
t/Biblio.t