Maybe there is a problem with the Tests\TestCase file. Open it and check it for errors
Test\TestCase not found
Hi - I'm trying to write a basic test in Laravel, but am getting the error: Uncaught Error: Class "Tests\TestCase" not found in C:\xampp\htdocs\tdrwip\tests\Feature\Libraries\LibraryIndexTest.php:9. Here's the code:
<?php
namespace Tests\Feature\Libraries;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class LibraryIndexTest extends TestCase
{
/**
* A basic feature test example.
*
* @return void
*/
public function test_example()
{
$response = $this->get('/');
$response->assertStatus(200);
}
}
Using phpstorm, when I right-click the TestCase -> GoTo -> Super Method, nothing happens. My tests directory is: /tests
- Feature
- Unit
- CreatesApplication.php
- TestCase.php
My composer.json includes: "autoload-dev": { "psr-4": { "Tests\": "tests/" } I'm on Laravel 8.83.6. Has anyone else run into this and found a cause/fix? Thanks! },
Thanks again @sinnbeck. That didn't fix the problem, so I created a new environment, re-installed the application, and it is working as expected now. It doesn't help me understand the problem or find a real solution, but the train is back on the tracks again1
Please or to participate in this conversation.