Summary: | UT: VirtualShelves.t needs some more adjustments | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Test Suite | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | bgkriegel, chrish, gmcharlt, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10290 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 10290 | ||
Bug Blocks: | |||
Attachments: |
Bug 10386: VirtualShelves.t needs some more adjustments
Bug 10386: VirtualShelves.t needs some more adjustments Bug 10386: VirtualShelves.t needs some more adjustments |
Description
Marcel de Rooy
2013-05-31 17:29:13 UTC
(In reply to comment #0) > IMO this unit test should not just delete all records at the start. (Why > ruin my test database for lazy programming :) ? Indeed. I think a worthwhile goal would be for each DB-dependent test (or perhaps the DB-dependent test suite as a whole) to leave the database in essentially the same state it started in. Created attachment 18821 [details] [review] Bug 10386: VirtualShelves.t needs some more adjustments 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. (In reply to comment #0) > Will also add two small new tests for AddShare from bug 9032. This patch does not depend on bug 9032. The tests for AddShare are added on bug 10441. Created attachment 19178 [details] [review] Bug 10386: VirtualShelves.t needs some more adjustments 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> Created attachment 19273 [details] [review] Bug 10386: VirtualShelves.t needs some more adjustments 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> Pushed to master. Thanks, Marcel! This patch has been pushed to 3.12.x, will be in 3.12.2. Thanks Marcel! Pushed to 3.10.x, will be in 3.10.8 Pushed to 3.8.x, will be in 3.8.17 |