PHPUnit replaces the path passed to the visit function
<p>I'm using Laravel 5.2 with PHPUnit 4 and wrote myself some tests. They are all successful except for one.</p>

<pre><code>public function testCostTypeEdit()
{
    $role = factory(\Bican\Roles\Models\Role::class)-&gt;create();
    $user = factory(\App\Model\User::class)-&gt;create();
    $user-&gt;attachRole($role);

    $costType = factory(\App\Model\CostType::class)-&gt;create();

    $this-&gt;actingAs($user)
        -&gt;visit('admin/reservations')
        -&gt;see(trans('strings.costType'))
        -&gt;see($costType-&gt;description)
        -&gt;type(15, $costType-&gt;slug)
        -&gt;press(trans('strings.save'))
        -&gt;see(trans('messages.costType'));
}
</code></pre>

<p>This test always fails and I get this error</p>

<pre><code>1) AdminReservationTest::testCostTypeEdit
A request to [http://localhost/admin.cars] failed. Received status code [404].

C:\xampp\htdocs\AppName\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\InteractsWithPages.php:178
C:\xampp\htdocs\AppName\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\InteractsWithPages.php:72
C:\xampp\htdocs\AppName\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\InteractsWithPages.php:120
C:\xampp\htdocs\AppName\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\InteractsWithPages.php:72
C:\xampp\htdocs\AppName\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\InteractsWithPages.php:53
C:\xampp\htdocs\AppName\tests\AdminReservationTest.php:94
C:\xampp\php\pear\PHPUnit\TextUI\Command.php:176
C:\xampp\php\pear\PHPUnit\TextUI\Command.php:129
</code></pre>

<p>As you can see the test fails because he trys to visit 'admin.cars'. There are two problems with that:
First I don't have a route called 'admin.cars' I only have 'admin/cars' therefor the 404.<br>
Seconed that isn't even the path I passed to the visit function.</p>

<p>I have 3 other tests for 'admin/reservation' that look identical to the one above. I copied one of them and replaced everything inside of testCostTypeEdit() and the test worked. When I change even one line it fails with the same error again.</p>

<p>When I pass him the path to any other route I have it isn't replaced and I don't get the 404 error.</p>

<p>When I pass him a non-existing path like 'adminreservations' it isn't replaced either</p>

<pre><code>1) AdminReservationTest::testCostTypeEdit
A request to [http://localhost/adminreservations] failed. Received status code [404].

C:\xampp\htdocs\AppName\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\InteractsWithPages.php:178
C:\xampp\htdocs\AppName\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\InteractsWithPages.php:72
C:\xampp\htdocs\AppName\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\InteractsWithPages.php:53
C:\xampp\htdocs\AppName\tests\AdminReservationTest.php:94
C:\xampp\php\pear\PHPUnit\TextUI\Command.php:176
C:\xampp\php\pear\PHPUnit\TextUI\Command.php:129
</code></pre>

<p>I don't know what I should try anymore.<br>
Does anyone of you have an idea why this happens?<br>
If you need some more information I'm happy to give it to you.</p>