Bug 10386: improvements to VirtualShelves.t
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 3 Jun 2013 13:27:50 +0000 (15:27 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 28 Jun 2013 12:19:49 +0000 (05:19 -0700)
commit93e87ca0b61611fc35238bf13eb226f477cf9c4e
tree021f6a27e31af5ef003918d4e237857eb359f8ba
parent2bcec70262ce8127e3755327d4d5261e0e964844
Bug 10386: improvements to VirtualShelves.t

Most important: Does no longer delete all shelves!
Checks if there are ten borrowers for testing. But even works without them :)
When creating or modifying lists, takes name clashes into consideration.

Small change to _CheckShelfName in VirtualShelves module. Making it possible to
check a name for a list whose owner has been set to NULL. Note that a test
like field=? with undef for placeholder will not work in MySql.

Test plan:
How do you test a test? Well, you could run it on various databases..
But for real hacking, you could also add some debug lines.
I tested this by forcing 10 undefs in @borrowernumbers.
And by overwriting the return value of randomname with an existing name.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/VirtualShelves.pm
t/db_dependent/VirtualShelves.t