]> git.koha-community.org Git - koha.git/commit
Bug 15160: GetTopIssues.t should create random data
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 9 Nov 2015 14:35:03 +0000 (11:35 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 10 Nov 2015 12:27:55 +0000 (09:27 -0300)
commit9c20a3f7976ce1ff41c18113cb5a8f0c7a3a80e7
tree74c31a08d8527b7eb6d93e65ca05c38e5ce0d342
parent4a4dbbf1237c93e0233eef0600015c9be3320bf0
Bug 15160: GetTopIssues.t should create random data

This patch refactors t/db_dependent/Circulation/GetTopIssues.t so it
creates its own data with random values. It does so by replacing (legacy)
SQL inserts and fixed value data inserting by TestBuilder generated data.

There is no expected behaviour change.

To test:
- Create an itemtyp directly on your DB with GTI_I_TEST as its itemtype
  > INSERT INTO itemtypes (itemtype) VALUES ('GTI_I_TEST');
- Run:
  $ prove t/db_dependent/Circulation/GetTopIssues.t
=> FAIL: The insert line fails
- Apply the patch
- Run:
  $ prove t/db_dependent/Circulation/GetTopIssues.t
=> SUCCESS: tests pass due to random data usage.
- Sign off

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Test plan produces the expected result, failing, then OK.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/db_dependent/Circulation/GetTopIssues.t