Only Breeze's default auth/profile tests existed - nothing covered Workouts, Sessions, Exercises, Yoga, Favorites, Blog, or the Admin panel, which is the actual product. Adds factories for the domain models and 45 new feature tests covering the main flows plus authorization boundaries (owner-only access on workouts/sessions, admin-only access on /admin, drafts hidden from the public blog). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
26 lines
673 B
PHP
26 lines
673 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Exercise>
|
|
*/
|
|
class ExerciseFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
$name = ucfirst(fake()->unique()->words(3, true));
|
|
|
|
return [
|
|
'name' => $name,
|
|
'slug' => Str::slug($name),
|
|
'exercise_db_id' => (string) fake()->unique()->numberBetween(1, 999999),
|
|
'gif_url' => 'https://example.com/exercise.gif',
|
|
'instructions' => implode("\n", fake()->sentences(3)),
|
|
];
|
|
}
|
|
}
|