Skip to content

Cannot feature test multilanguage routes #113

Description

@jakobbuis
  • Localization Version: 2.1.0
  • Laravel Version: 5.5.22
  • PHP Version: 7.1.8-1ubuntu1

Description:

I cannot test multilanguage translated routes. Created routes work in the browser, but never in a testcase. Tried it using a empty Laravel-project, which doesn't work either. I'd like to start a PR, but I have no clue where to start at this point in time.

Steps To Reproduce:

  1. Create a new, empty Laravel project:
    composer create-project --prefer-dist laravel/laravel loctest
  2. Require the localization package
    composer require "arcanedev/localization:^2.1"
  3. Publish the configuration file
    php artisan vendor:publish --provider="Arcanedev\Localization\LocalizationServiceProvider"
  4. Change routes/web.php to:
    Route::localizedGroup(function () {
        Route::view('/', 'welcome');
    });
  5. Change the test method in tests/Feature/ExampleTest.php to:
    public function testBasicTest()
    {
        $response = $this->get('/en');
        $response->assertStatus(200);
    }
  6. Run the tests: vendor/bin/phpunit.

Expected

No changes in the testcase

Happened

PHPUnit 6.4.4 by Sebastian Bergmann and contributors.

F.                                                                  2 / 2 (100%)

Time: 73 ms, Memory: 12.00MB

There was 1 failure:

1) Tests\Feature\ExampleTest::testBasicTest
Expected status code 200 but received 404.
Failed asserting that false is true.

/home/jakob/code/loctest/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:78
/home/jakob/code/loctest/tests/Feature/ExampleTest.php:19

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions