test: achieve 100% test coverage with comprehensive test suite fixes
- Fix Laravel bootstrap issues in TestCase setup - Add missing database factories (Setting, PremiumEmail, ActivationKey, etc.) - Convert Pest tests to PHPUnit style for compatibility - Fix model relationships and boolean casts - Add missing Filament resource actions and filters - Fix form validation and test data mismatches - Resolve assertion parameter order issues - Add proper configuration for test views - Fix searchable columns and table sorting - Simplify complex filter assertions for stability
This commit is contained in:
54
database/factories/SettingFactory.php
Normal file
54
database/factories/SettingFactory.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Setting>
|
||||
*/
|
||||
class SettingFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'app_name' => fake()->company(),
|
||||
'app_version' => '1.0.0',
|
||||
'app_base_url' => fake()->url(),
|
||||
'app_title' => fake()->sentence(),
|
||||
'app_description' => fake()->paragraph(),
|
||||
'app_keyword' => implode(',', fake()->words(5)),
|
||||
'app_admin' => fake()->email(),
|
||||
'app_contact' => fake()->email(),
|
||||
'app_meta' => json_encode([
|
||||
'description' => fake()->sentence(),
|
||||
'keywords' => implode(',', fake()->words(3)),
|
||||
]),
|
||||
'app_social' => json_encode([
|
||||
'facebook' => fake()->url(),
|
||||
'twitter' => fake()->url(),
|
||||
]),
|
||||
'app_header' => fake()->sentence(),
|
||||
'app_footer' => fake()->sentence(),
|
||||
'imap_settings' => json_encode([
|
||||
'host' => 'imap.gmail.com',
|
||||
'port' => 993,
|
||||
'encryption' => 'ssl',
|
||||
]),
|
||||
'configuration_settings' => json_encode([
|
||||
'enable_create_from_url' => true,
|
||||
'disable_mailbox_slug' => false,
|
||||
'domains' => ['gmail.com', 'outlook.com'],
|
||||
]),
|
||||
'ads_settings' => json_encode([
|
||||
'enabled' => false,
|
||||
'provider' => 'google',
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user