V
V
Voll.2016-06-07 20:54:14
Laravel
Voll., 2016-06-07 20:54:14

Laravel how to test route prefixed with variable?

My route.php looks like

Route::group( array('prefix'=> '{lang}'), function(){

    Route::get('/',function (){

        return view('frontend.index');
    });
});

When running the test
public function testBasicExample()
    {
        $this->visit('/en/')->see('Polski');
    }

I get an error
A request to [minishop.dev/en] failed. Received status code [404].

The URL is correct, everything is OK in the browser, but the test fails...
What could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Voll., 2016-06-07
@vollthegreat

Stupid, decided to write
instead
protected $baseUrl = 'minishop.dev';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question