I wrote the test:
$response = $this->get('/something');
$response->assertStatus(200);
It displays this error:
Error: Call to undefined method Tests\Unit\SomeTest::assertStatus()
I found how I can fix my problem (code is below) but I want to use first method:
$response = $this->get('/something');
$this->assertEquals(200, $this->response->status());
Why doesn't the first code work?
I solved it by changing use PHPUnit\Framework\TestCase
to use Tests\TestCase
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With