Bug 24145: (bug 22543 follow-up) Fix Auth.t
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 2 Dec 2019 16:50:40 +0000 (17:50 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 2 Dec 2019 17:13:27 +0000 (17:13 +0000)
commitece3e5a6a2be3870b53cde01516a189d23423a68
treea953244d52d09b06f12375842be31a2bdd0cb50b
parent1a78447367d9fb23f17f64ed405bfad9c333e190
Bug 24145: (bug 22543 follow-up) Fix Auth.t

Auth.t is failing because of: 1. recent changes from bug 22543 and 2. wrong mocked CGI->param in tests
Without this patch we hit the exit statement that breaks the tests with the following error:

t/db_dependent/Auth.t .. 1/22 Un-mocked method 'url()' called at /kohadevbox/koha/C4/Auth.pm line 1223.
Un-mocked method 'redirect()' called at /kohadevbox/koha/C4/Auth.pm line 1227.
A context appears to have been destroyed without first calling release().
Based on $@ it does not look like an exception was thrown (this is not always
a reliable test)

This is a problem because the global error variables ($!, $@, and $?) will
not be restored. In addition some release callbacks will not work properly from
inside a DESTROY method.

Here are the context creation details, just in case a tool forgot to call
release():
  File: t/db_dependent/Auth.t
  Line: 74
  Tool: Test::More::subtest

Cleaning up the CONTEXT stack...
    # Looks like you planned 22 tests but ran 1.
t/db_dependent/Auth.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 21/22 subtests

Test Summary Report
-------------------
t/db_dependent/Auth.t (Wstat: 65280 Tests: 1 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 22 tests but ran 1.
Files=1, Tests=1,  2 wallclock secs ( 0.02 usr  0.00 sys +  1.54 cusr  0.24 csys =  1.80 CPU)
Result: FAIL

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
t/db_dependent/Auth.t