I'm just getting started with the Laravel 8 testing suite and have opted to create a feature test for my account creation process. I've ran php artisan make:test AccountCreation
and have written the first test case as a function, however, when I run php artisan test
it's not picking up my feature tests, why?
Equally, if I try to delete the default example test, I get an error telling me that the test can't be found? What am I missing?
tests/Feature/AccountCreation.php
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class AccountCreation extends TestCase
{
/**
* A basic feature test example.
*
* @return void
*/
public function test_creates_user_account_successfully()
{
$response = $this->post('/api/account/create');
$response->assertStatus(201);
}
}
Is there a special command I need to run for Laravel to pick up these tests?
AccountCreation
toAccountCreationTest
. Oh, and rename the file accordingly as well. – Possessive