36 lines
888 B
PHP
36 lines
888 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Database\Seeders;
|
||
|
|
|
||
|
|
use App\Models\User;
|
||
|
|
use Illuminate\Database\Seeder;
|
||
|
|
use Illuminate\Support\Facades\Hash;
|
||
|
|
|
||
|
|
class TestUserSeeder extends Seeder
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Run the database seeds for E2E testing.
|
||
|
|
*/
|
||
|
|
public function run(): void
|
||
|
|
{
|
||
|
|
// Create a standard test user for login tests
|
||
|
|
User::firstOrCreate(
|
||
|
|
['email' => 'test@example.com'],
|
||
|
|
[
|
||
|
|
'name' => 'Test User',
|
||
|
|
'password' => Hash::make('password123'),
|
||
|
|
'email_verified_at' => now(),
|
||
|
|
]
|
||
|
|
);
|
||
|
|
|
||
|
|
// Create additional test users if needed
|
||
|
|
User::firstOrCreate(
|
||
|
|
['email' => 'admin@example.com'],
|
||
|
|
[
|
||
|
|
'name' => 'Admin User',
|
||
|
|
'password' => Hash::make('admin123'),
|
||
|
|
'email_verified_at' => now(),
|
||
|
|
]
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|