环境:PHP 7.0 macOS apache
代码是:
public function testBasicExample()
{
$this->visit('/');
}
运行phpunit。 结果是:
1) ExampleTest::testBasicExample
A request to [http://localhost] failed. Received status code [404].
在Chrome中一直都是正常的。
答案 0 :(得分:0)
答案 1 :(得分:-1)
您需要修改TestCase.php
文件并更新
protected $baseUrl = 'http://localhost'
与
protected $baseUrl = 'HOST OR URL THAT YOU USE TO ACCESS YOUR SITE'