]> git.koha-community.org Git - koha.git/commit
Bug 28020: Unit tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Dec 2021 11:20:11 +0000 (08:20 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 5 Jan 2022 23:33:46 +0000 (13:33 -1000)
commit320437e7bd980779e44aa930b83741405f124fbb
treee59ea50db5cfa6ae27993f1e4f6e9fad7fe95503
parent942d7cd8a69b222ca9b914970bee2b8cf5b65acf
Bug 28020: Unit tests

The unhandled_exception() Mojo helper didn't have proper tests. As this
bug is adding a slight behavior change, I tried to add some. As it
relies on the OpenAPI plugin, it cannot be done the usual way using
Mojo::Lite. So I picked a route and forced an exception through mocking
to be able to write tests.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/unhandled_exceptions.t
=> FAIL: The unhandled_exception() helper doesn't return an error_code
in the response payload.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
t/db_dependent/api/v1/unhandled_exceptions.t [new file with mode: 0755]