Bug 33967: Add unit test to ensure SetEnv doesn't compromise $env
authorDavid Cook <dcook@prosentient.com.au>
Fri, 9 Jun 2023 06:46:43 +0000 (06:46 +0000)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Wed, 12 Jul 2023 09:41:27 +0000 (09:41 +0000)
commit67d27898df8ec312733cfe81a91109697b7d590a
tree96880f814441330828c1f29c1d2c4d9739ee9ce4
parent48003a890b2948a6c0616ad45ea5a220748b8aa2
Bug 33967: Add unit test to ensure SetEnv doesn't compromise $env

This patch includes a unit test which checks the memory address
of the $env hashref in middlewares before and after
Koha::Middleware::Env is applied.

It succeeds when the same $env is maintained before and after
this middleware. It fails if the $env has been overwritten with
a new hashref (as evidenced by the new memory address for the
hash).

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c7142fe940e7eed25afc814bb8afb017e5f90ea)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f73dbd00ad595a3d35e334902a2c3708da8c46ed)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
t/Koha/Middleware/SetEnv.t [new file with mode: 0755]