Bug 18434: Add tests for K:SE:E::get_fixer_rules
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 12 May 2017 18:39:25 +0000 (15:39 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 6 Jul 2017 17:29:02 +0000 (14:29 -0300)
commit2d19a34529bc313922a085a99288e55d8634c8b6
tree25ebb14a36f3339c968a87b325f8d05f0f1cd6f2
parent8b15c064405ff4a48cb3f5803dd6bd16d49d5b9b
Bug 18434: Add tests for K:SE:E::get_fixer_rules

This patch tries to introduce exhaustive tests for this class method.
I didn't try to provide a regression test for the current bug per-se, but
cover the current method behaviour as much as I could.

(kidclamp) I added a quick test of _convert_marc_to_json to use the mocking here
and illuminate what the change does, before the patches this should
fail (fields are indexed in place of one another), after it should succeed (new indexed fields are appended).

A minor bug is highlighted by this new tests, I'll provide a followup for it.

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ de kohaclone
 k$ prove t/db_dependent/Koha_Elasticsearch.t
=> FAIL: The returned fixer rules are not the expected ones

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