- AuthTest, ProgramTest, CheckinTest, QuestionnaireTest, CertificateTest — 19 feature tests, 35 total pass - ProgramFactory with published() state - UserFactory: is_admin=true default, nonAdmin() state - Fix attendance_source column name in StatisticsController (was: source) - Fix route(dashboard) → route(admin.dashboard) in all Breeze auth controllers - Remove irrelevant Breeze boilerplate tests (Profile, Example, Registration) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
921 B
PHP
31 lines
921 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class ProgramFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'title' => fake()->sentence(3),
|
|
'organizer' => fake()->company(),
|
|
'location' => fake()->city(),
|
|
'start_date' => now()->toDateString(),
|
|
'end_date' => now()->toDateString(),
|
|
'status' => 'draft',
|
|
'allow_walk_in' => true,
|
|
'default_staff_session' => 'pagi',
|
|
'default_external_session' => 'pagi',
|
|
'created_by' => User::factory(),
|
|
];
|
|
}
|
|
|
|
public function published(): static
|
|
{
|
|
return $this->state(fn () => ['status' => 'published']);
|
|
}
|
|
}
|