I am running a test, as featured on one of the series. But I'm not getting the same errors.
For some reason my the test 'a_user_can_browse_threads' isn't found even though it is clearly there. Have I missed something?
[all errors and code]
"Mikey@Home MINGW64 /c/wamp/projects/forum
$ phpunit
PHPUnit 6.4.4 by Sebastian Bergmann and contributors.
W. 2 / 2 (100%)
Time: 203 ms, Memory: 10.00MB
There was 1 warning:
Warning
No tests found in class "Tests\Feature\ThreadsTest".
WARNINGS!
Tests: 2, Assertions: 1, Warnings: 1."
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class ThreadsTest extends TestCase
{
use DatabaseMigrations;
/**
* Test
*/
public function a_user_can_browse_threads()
{
$response = $this->get('/threads');
$response->assertStatus(200);
}
}
I got it to work. For some reason the function wasn't being recognised.
I applied "test_" at the beginning of the function and it worked.
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class ThreadsTest extends TestCase
{
use DatabaseMigrations;
/**
* Test
*/
public function test_a_user_can_browse_threads()
{
$response = $this->get('/threads');
$response->assertStatus(200);
}
}