2

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.

rap-2-h
  • 30,204
  • 37
  • 167
  • 263
kair
  • 21
  • 1
  • 5

2 Answers2

0

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

medard mandane
  • 549
  • 4
  • 6
-1

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'
Ariful Haque
  • 3,662
  • 5
  • 37
  • 59