Laravel 5.4 - 基本测试 - NotFoundHttpException

I have a problem running the basic test that ships with Laravel:

app/tests/Feature/ExampleTest.php

class ExampleTest extends TestCase
{
    /**
     * A basic test example.
     *
     * @return void
     */
    public function testBasicTest()
    {
        $response = $this->get('/');

        $response->assertStatus(200);
        $this->assertTrue(true);
    }
}

When I run it I get the exception NotFoundHttpException. I can access my website in the browser without problems. This problem appears to apply to all my routes.

Using Laravel 5.4

The route / is defined in app/routes/web.php.

It seems that in Laravel 5.4 $baseUrl property was removed from TestCase class.

You may add some setUp to your ExampleTest:

function setUp()
{
    parent::setUp();
    config(['app.url' => 'https://myserver']);
}

Hope this helps!