|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
|
|
use App\Profile;
|
|
|
|
|
use App\Status;
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
|
|
class StatusFactory extends Factory
|
|
|
|
|
{
|
|
|
|
|
protected $model = Status::class;
|
|
|
|
|
|
|
|
|
|
public function definition(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'profile_id' => Profile::factory(),
|
|
|
|
|
'type' => 'text',
|
|
|
|
|
'caption' => fake()->sentence(),
|
|
|
|
|
'in_reply_to_id' => null,
|
|
|
|
|
'in_reply_to_profile_id' => null,
|
|
|
|
|
'reblog_of_id' => null,
|
|
|
|
|
'is_nsfw' => false,
|
|
|
|
|
'scope' => 'public',
|
|
|
|
|
'visibility' => 'public',
|
|
|
|
|
'cw_summary' => null,
|
|
|
|
|
'comments_disabled' => false,
|
|
|
|
|
'likes_count' => 0,
|
|
|
|
|
'reblogs_count' => 0,
|
|
|
|
|
'reply_count' => 0,
|
|
|
|
|
'local' => true,
|
feat: add framework integration tests for Laravel 12→13 upgrade readiness
Framework tests verify core Laravel integration points:
- ServiceProviderTest: app boot, guard resolution, route loading, config_cache
- RoutingTest: named routes, duplicates, api/oauth prefixes, middleware groups
- EloquentTest: User/Profile/Status factories, relationships, casts, soft deletes
- QueueTest: job dispatch, serialization, middleware, unique IDs
- ConfigTest: config loading, env overrides, auth/cache/queue settings
- MiddlewarePipelineTest: CSRF, auth, throttle, password confirm, 2FA, admin
Also:
- Add HasFactory trait to Status model
- Fix StatusFactory: remove non-existent 'place' column, add 'rendered' field
- Add Api/AccountTest for account endpoint coverage (254 total tests)
1 month ago
|
|
|
'rendered' => '',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function photo(): static
|
|
|
|
|
{
|
|
|
|
|
return $this->state(fn (array $attributes) => [
|
|
|
|
|
'type' => 'photo',
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function video(): static
|
|
|
|
|
{
|
|
|
|
|
return $this->state(fn (array $attributes) => [
|
|
|
|
|
'type' => 'video',
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function private(): static
|
|
|
|
|
{
|
|
|
|
|
return $this->state(fn (array $attributes) => [
|
|
|
|
|
'scope' => 'private',
|
|
|
|
|
'visibility' => 'private',
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function unlisted(): static
|
|
|
|
|
{
|
|
|
|
|
return $this->state(fn (array $attributes) => [
|
|
|
|
|
'scope' => 'unlisted',
|
|
|
|
|
'visibility' => 'unlisted',
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function nsfw(): static
|
|
|
|
|
{
|
|
|
|
|
return $this->state(fn (array $attributes) => [
|
|
|
|
|
'is_nsfw' => true,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function reply(): static
|
|
|
|
|
{
|
|
|
|
|
return $this->state(fn (array $attributes) => [
|
|
|
|
|
'type' => 'reply',
|
|
|
|
|
'in_reply_to_id' => Status::factory(),
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|