Bug 28565: Refactor tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 22 Jun 2021 14:43:03 +0000 (11:43 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 26 Jul 2021 10:46:35 +0000 (12:46 +0200)
commitf891156f424a466aadb5ab85c445fcdbae4f3536
tree41b2f5499b7d94d78b6f70b27b5392a9f0e3c1c4
parentb7c955c95009c1e272b64e7d17190a0db3719424
Bug 28565: Refactor tests

Tests were too complex with no gain. They even deleted the whole DB to
run (inside a transaction). I refactored to test the same thing, and
make it rely (mostly) on existing data.

_count behavior is tested implicitly by comparing with Koha::*->count.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/UsageStats.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/UsageStats.t