22
33namespace Moox \Item \Tests ;
44
5+ use Illuminate \Foundation \Testing \RefreshDatabase ;
56use Moox \Item \ItemServiceProvider ;
6- use Orchestra \Testbench \TestCase as Orchestra ;
77use Orchestra \Testbench \Attributes \WithMigration ;
8- use Illuminate \Foundation \Testing \RefreshDatabase ;
9- use Illuminate \Database \Eloquent \Factories \Factory ;
10-
8+ use Orchestra \Testbench \TestCase as Orchestra ;
119
12- #[WithMigration('laravel ' , 'cache ' , 'queue ' )]
10+ #[WithMigration('laravel ' , 'cache ' , 'queue ' )]
1311#[WithMigration('session ' )]
1412class TestCase extends Orchestra
1513{
1614 use RefreshDatabase;
15+
1716 protected function setUp (): void
1817 {
1918 parent ::setUp ();
20-
2119 }
2220
2321 protected function getPackageProviders ($ app )
@@ -27,13 +25,11 @@ protected function getPackageProviders($app)
2725 ];
2826 }
2927
30-
31-
3228 protected function setUpTestUser (): array
3329 {
3430 // Create users table (included in Laravel migrations via WithMigration attribute)
3531 // Orchestra Testbench automatically creates users table with #[WithMigration('laravel')]
36-
32+
3733 return [
3834 'name ' => 'Test User ' ,
3935 'email ' => 'test@example.com ' ,
@@ -44,15 +40,18 @@ protected function setUpTestUser(): array
4440 protected function createTestUser (): object
4541 {
4642 $ userData = $ this ->setUpTestUser ();
47-
43+
4844 // Use Laravel's built-in User model for testing
4945 $ userClass = config ('item.auth.user ' , 'Testbench \\Models \\User ' );
50-
51- if (!class_exists ($ userClass )) {
46+
47+ if (! class_exists ($ userClass )) {
5248 // Fallback to a simple test user
53- $ userClass = new class extends \Illuminate \Foundation \Auth \User {
49+ $ userClass = new class extends \Illuminate \Foundation \Auth \User
50+ {
5451 protected $ table = 'users ' ;
52+
5553 protected $ fillable = ['name ' , 'email ' , 'password ' ];
54+
5655 protected $ hidden = ['password ' ];
5756 };
5857 }
0 commit comments