Skip to content

version 0.7.8. http-mock issues warnings because timezone and breaks phpunit tests #36

Description

@JoeZ99

when trying to run tests with http-mock, there is this warning

PHPUnit 4.8.29 by Sebastian Bergmann and contributors.

.F.................................

Time: 203 ms, Memory: 10.00MB

There was 1 failure:

1) Doofinder\Api\Test\Management\ClientTest::testDummy
HTTP mock server standard error output should be empty
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
+[Thu Dec  1 10:37:39 2016] PHP Warning:  DateTime::createFromFormat(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/jzarate/havet/php-doofinder/vendor/symfony/http-foundation/Response.php on line 333
+[Thu Dec  1 10:37:39 2016] PHP Warning:  DateTime::createFromFormat(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/jzarate/havet/php-doofinder/vendor/symfony/http-foundation/Response.php on line 333

/home/jzarate/havet/php-doofinder/vendor/internations/http-mock/src/InterNations/Component/HttpMock/PHPUnit/HttpMockTrait.php:56
/home/jzarate/havet/php-doofinder/src/Test/Management/ClientTest.php:42

it's related to not having timezone defined.

Since http-mock starts its own process, nothing I do on phpunit tests (like disabling warnings, setting timezone, etc..) will fix this (http-mock runs in its own process)

I haven't found a way to pass php init options or the like to http-mock's process, phpunit is unusable

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions