Answer the question
In order to leave comments, you need to log in
Why was the ::get method not found when creating a request inside a test unit?
I'm trying to make a GET request to an application inside a test, and I'm getting the following error:
Error: Call to undefined method App\Http\Controllers\StepsControllerTest::get()
namespace Tests\Unit;
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use PHPUnit\Framework\TestCase;
class StepsControllerTest extends TestCase
{
public function testIndex() {
$response = $this->get('/');
$this->assertTrue(true);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question