Bug 33718: Fix the mock of Koha::Config->get in mock_config
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 11 May 2023 12:52:23 +0000 (12:52 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 16 May 2023 09:47:22 +0000 (11:47 +0200)
commit50d3c3c0a8328d6cd5529bcaa1444ab93ab1fb7e
tree37ab14ccd2861c7d25f108d1025bd9bb5d8b59fd
parent45d99e7a0b5769dcfb763884cf2bbc3302dcf111
Bug 33718: Fix the mock of Koha::Config->get in mock_config

It should not mock calls for other sections than 'config' in
koha-conf.xml.

Test plan:
Without this patch:
[1] Enable AutoLinkBiblios, CatalogModuleRelink and LinkerRelink.
This will trigger a SearchAuthorities call when creating a sample biblio.
Note: SearchAuthorities calls Zconn and gets back information from
a wrong part of koha-conf.xml.
[2] Run t/db_dependent/Koha/Pseudonymization.t
You should see something like:
  {UNKNOWN}: Can't use string ("authorities") as a HASH ref while "strict refs" in use at /usr/share/koha/C4/Context.pm line 587. at /usr/share/koha/C4/Biblio.pm line 302

With this patch:
[3] Run t/db_dependent/Koha/Pseudonymization.t. Should pass now.
[4] git grep -l mock_config | xargs -i{} prove {}
    Exclude Mocks.pm.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
t/lib/Mocks.pm