The current C4::Matcher::_get_match_keys implementation doesn't take
normalization rules params into account. This patch makes Matcher.t test the
proposed behaviour for new hardcoded values, that match string normalization
routines introduced by Bu 17302.
Possible values are:
- upper_case
- lower_case
- remove_spaces
- legacy_default
- none
* 'legacy_default' is left (for now) to catch the current behaviour. So tests which
did not get a 'norm' param, now are passed 'legacy_default' and they still pass.
* 'none' means no normalization, of course
Note: on introducing 'none', a bug got highlighted, because the subfields traversal loop
was introducing an unneeded space. The tests from 17304 get adjusted to reflect this.
To test:
- Run:
$ sudo koha-shell kohadev ; cd kohaclone
$ prove t/Matcher.t
=> FAIL: The routine doesn't care about the norms param.
Sponsored-by: FIT
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This function is used in several places, but it's behaviour is not covered by tests, thus trying to patch it can be problematic without introducing regressions.
This patch introduces unit tests for it, in the t/Matcher.t file.
To test:
- Apply the patch
- Run:
$ prove t/Matcher.t
=> SUCCESS: Tests pass
- Sign off :-D
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Tests in t/ should always pass for building the Debian packages
for Koha. But we've started using Test::DBIx::Class for writing
mocked tests, and that lib is not (yet) packaged fro Debian 7+.
This means build is failing. Devs and jenkins use the lib from CPAN.
This patch makes the tests skip if the lib is absent.
To test:
- Install Test::DBIx::Class
$ sudo cpanm Test::DBIx::Class
- Run the tests:
$ prove t/
=> SUCCESS: Tests pass
- Uninstall Test::DBIx::Class
$ sudo cpan -U Test::DBIx::Class
- Run the tests:
$ prove t/
=> SUCCESS: Tests still pass (those needing the lib are skipped)
- Sign off :-D
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. All test pass successful
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>