I have this test file:
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Gameworld;
class SearchForGameworld extends TestCase
{
use DatabaseMigrations;
public function test_can_search_and_find_a_gameworld()
{
$gameworld = factory(Gameworld::class)->create([
'name' => 'DS Test 1'
]);
$this->visit('/game/search')
->see('Search For Game')
->type('DS', '#gameworld_name')
->press('Search')
->seePageIs('/game/search')
->see('Game Search Results')
->see('DS Test 1');
}
}
All tests pass.
OK (1 test, 7 assertions)
I add another test so the file now looks like this:
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Gameworld;
class SearchForGameworld extends TestCase
{
use DatabaseMigrations;
public function test_can_search_and_find_a_gameworld()
{
$gameworld = factory(Gameworld::class)->create([
'name' => 'DS Test 1'
]);
$this->visit('/game/search')
->see('Search For Game')
->type('DS', '#gameworld_name')
->press('Search')
->seePageIs('/game/search')
->see('Game Search Results')
->see('DS Test 1');
}
public function join_link_is_displayed_for_non_logged_in_user()
{
$gameworld = factory(Gameworld::class)->create([
'name' => 'DS Test 1'
]);
$this->visit('/game/search')
->see('Search For Game')
->type('DS', '#gameworld_name')
->press('Search')
->seePageIs('/game/search')
->see('Game Search Results')
->see('DS Test 1')
->see('Join');
}
}
I get the same test result:
OK (1 test, 7 assertions)
Is there any reason my second test isn't picked up?
Thanks.