我正在对Laravel Homestead流浪者实例运行Codeception。 PHP版本5.5.12,Laravel 4. *。 Codeception版本2.0.0。
我可以使用localhost:8000,127.0.0.1:8000或mysite.app:8000通过Chrome访问该网站。该站点还远程部署在AWS服务器上,该服务器没有域名,但公共IP地址在通过Chrome查看时工作正常。
我也可以在本地卷曲所有这些网址。
我已按照此处指示的设置步骤进行操作:http://codeception.com/quickstart
每一步,但最后一步都可以。
我的测试, WelcomeCert.php :
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('see the landing page');
$I->amOnPage('/');
$I->see('Welcome');
acceptance_suite.yml :
class_name: AcceptanceTester
modules:
enabled:
- PhpBrowser
- AcceptanceHelper
config:
PhpBrowser:
url: 'http://127.0.0.1:8000'
执行 codecept run 时的控制台输出:
1) Failed to see the landing page in WelcomeCept.php (/Users/andrew/code/site/tests/acceptance/WelcomeCept.php)
Sorry, I couldn't am on page "/":
GuzzleHttp\Exception\RequestException: strtotime(): 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.
Scenario Steps:
1. I am on page "/"
#1 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:250
#2 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:84
#3 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:70
#4 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:200
#5 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Subscriber/Cookie.php:57
#6 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/Emitter.php:105
#7 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php:75
#8 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/Curl/CurlAdapter.php:94
#9 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/StreamingProxyAdapter.php:34
#10 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Client.php:186
#1 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:250
#2 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:84
#3 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php:70
#4 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:200
#5 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Subscriber/Cookie.php:57
#6 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/Emitter.php:105
#7 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Event/RequestEvents.php:75
#8 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/Curl/CurlAdapter.php:94
#9 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Adapter/StreamingProxyAdapter.php:34
#10 /Users/andrew/code/site/vendor/guzzlehttp/guzzle/src/Client.php:186
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
当我尝试访问http://www.google.com或http://www.github.com时出现同样的错误。
答案 0 :(得分:2)
只是我的评论作为答案。
看起来您还没有在本地计算机上设置php.ini中的时区设置。请参阅php.net/manual/en/datetime.configuration.php
GuzzleHttp \ Exception \ RequestException:strtotime():依赖系统的时区设置是不安全的。您必需使用date.timezone设置或date_default_timezone_set()函数。如果您使用了这些方法中的任何一种并且仍然收到此警告,则很可能拼错了时区标识符。我们选择了时区&#39; UTC&#39;现在,请设置date.timezone以选择您的时区。