]> git.koha-community.org Git - koha.git/commit
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)
committerPedro Amorim <pedro.amorim@ptfs-europe.com>
Wed, 7 Jun 2023 10:16:07 +0000 (10:16 +0000)
commit040507198715fb59a23e25590bdcaaf7b73cbfad
tree5682e8c06c39f20e16fe3cd7955a6f89e14d2621
parente14529807a340714de8e95df3b0f48185da481a1
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>
(cherry picked from commit 50d3c3c0a8328d6cd5529bcaa1444ab93ab1fb7e)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
t/lib/Mocks.pm