CiviTestListener - Headless tests should have initialized timezone
authorTim Otten <totten@civicrm.org>
Wed, 8 Feb 2023 22:47:51 +0000 (14:47 -0800)
committerTim Otten <totten@civicrm.org>
Wed, 8 Feb 2023 22:51:54 +0000 (14:51 -0800)
commit8ab6ac202a65e0730c3d7fbb23c0f025d9a51eec
treeb5f4cf54e8bcac730918218f7b8755f36af37825
parent652617f42db5aea38c39b0788ed2c5e30b4df110
CiviTestListener - Headless tests should have initialized timezone

Before
------

* `CiviUnitTestCase` calls `setMySQLTimeZone()`
* Headless tests (which are initialized via `CiviTestListener`) do not call `setMySQLTimeZone()`
* If you have a test like 5.57's flavor of `QueueTest`, then the tests pass or fail depending on happenstance of server timezone configuration.

After
-----

* `CiviUnitTestCase` and `CiviTestListener` both call `setMySQLTimeZone()`
* If you have a test like 5.57's flavor of `QueueTest`, then the tests pass more consistently.

Comments
--------

This branch should work cleanly as PR for `5.59` (rc) or `master`.  I'd
rather like to use this in `5.57-esr` (so that tests run more cleanly).
So maybe `5.59` is the better target (but it doesn't strictly have to be).
Civi/Test/CiviTestListener.php
Civi/Test/CiviTestListenerPHPUnit7.php
Civi/Test/Legacy/CiviTestListener.php