dimanche 14 août 2016

Laravel 5.2 Unit Test 404

I have this simple test set up and I'm trying to find out why when I run this test I get this error message. When I visit myapp.app in my browser I see the welcome page for the install of Laravel 5.2.

There were 2 failures:

1) ExampleTest::testExample
A request to [myapp.app] failed. Received status code [404].

Parent Test Class

<?php

use Illuminate\Foundation\Testing\DatabaseTransactions;

abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
{
    use DatabaseTransactions;

    /**
     * The base URL to use while testing the application.
     *
     * @var string
     */
    protected $baseUrl = 'myapp.app';

    /**
     * Creates the application.
     *
     * @return \Illuminate\Foundation\Application
     */
    public function createApplication()
    {
        $app = require __DIR__.'/../bootstrap/app.php';

        $app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();

        return $app;
    }
}

Default Example Test From Laravel Installation

<?php

use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;

class ExampleTest extends TestCase
{
    /**
     * A basic test example.
     *
     * @return void
     */
    public function testExample()
    {
        $this->visit('/')
            ->see('Laravel 5');
    }
}

Aucun commentaire:

Enregistrer un commentaire