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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 9 Jun 2023 11:50:13 +0000 (08:50 -0300)
commit2c7142fe940e7eed25afc814bb8afb017e5f90ea
treee747f5869df433fb3948fc5cadea6599f83e1e9b
parent42823da209bbef2148eb4245c1bdfe215bf899ee
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>
t/Koha/Middleware/SetEnv.t [new file with mode: 0755]