laravel-easypanel
laravel-easypanel copied to clipboard
Testing messed out
After installing the package, whenever I run my tests that involves my user model, I get this
Class "EasyPanelTest/Dependencies/User" not found
Could you please share your tests with their imported namespaces?
Here is a snapshot of some of the tests that causes the issue, of course others that uses the user model also causes the same issue.
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
class UserTest extends TestCase
{
use RefreshDatabase, WithFaker;
public function test_user_can_logout_via_api()
{
Sanctum::actingAs(
User::factory()->create()
);
$response = $this->postJson('/api/logout');
$response->assertStatus(200);
}
public function test_user_can_update_fields()
{
Sanctum::actingAs(
User::factory()->create()
);
$data = [
'field' => 'name',
'value' => 'testUpdate'
];
$response = $this->postJson('/api/profile/update', $data);
$response->assertStatus(200);
}
public function test_user_can_update_email()
{
Sanctum::actingAs(
User::factory()->create()
);
$data = [
'field' => 'email',
'value' => '[email protected]'
];
$response = $this->postJson('/api/profile/update', $data);
$response->assertStatus(200);
}
}
Any news?