2
votes

Environment: PHP 7.0 macOS apache

The code is :

public function testBasicExample()
{
    $this->visit('/');
}

Run phpunit. The result is:

1) ExampleTest::testBasicExample
A request to [http://localhost] failed. Received status code [404].

It's always normal when in Chrome.

2
Are you using vagrant or any VM?Ariful Haque
no..........................kair

2 Answers

0
votes

I found a solution for this issue, it is by using the url provided by

php artisan serve

Please visit this thread for more info

-1
votes

You need to edit your TestCase.php file and update

protected $baseUrl = 'http://localhost'

with

protected $baseUrl = 'HOST OR URL THAT YOU USE TO ACCESS YOUR SITE'