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:
@@ -15,8 +15,9 @@ class DatabaseSeeder extends Seeder
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
$this->call([
|
||||
MetaSeeder::class,
|
||||
MetaSeeder::class,
|
||||
AdminSeeder::class,
|
||||
SettingsSeeder::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
66
database/seeders/SettingsSeeder.php
Normal file
66
database/seeders/SettingsSeeder.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class SettingsSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Clear existing settings
|
||||
DB::table('settings')->delete();
|
||||
|
||||
// Seed settings table with default values
|
||||
DB::table('settings')->insert([
|
||||
'id' => 1,
|
||||
'app_name' => 'ZEmailnator',
|
||||
'app_version' => '1.0',
|
||||
'app_base_url' => 'http://localhost:8000',
|
||||
'app_admin' => 'admin@zemail.me',
|
||||
'app_title' => 'ZEmailnator - Temporary Email Service',
|
||||
'app_description' => 'Free temporary email service for protecting your privacy',
|
||||
'app_keyword' => 'temporary email, disposable email, fake email',
|
||||
'app_contact' => 'support@zemail.me',
|
||||
'app_meta' => json_encode(['author' => 'ZEmailnator', 'version' => '1.0']),
|
||||
'app_social' => json_encode(['twitter' => '@zemailnator', 'github' => 'zemailnator']),
|
||||
'app_header' => 'Welcome to ZEmailnator',
|
||||
'app_footer' => '© 2025 ZEmailnator. All rights reserved.',
|
||||
'imap_settings' => json_encode([
|
||||
'host' => 'imap.gmail.com',
|
||||
'port' => 993,
|
||||
'protocol' => 'imap',
|
||||
'encryption' => 'ssl',
|
||||
'validate_cert' => true,
|
||||
'username' => 'test@gmail.com',
|
||||
'password' => 'password',
|
||||
]),
|
||||
'configuration_settings' => json_encode([
|
||||
'custom_username_length_min' => 3,
|
||||
'custom_username_length_max' => 20,
|
||||
'random_username_length_min' => 6,
|
||||
'random_username_length_max' => 12,
|
||||
'forbidden_ids' => ['admin', 'root', 'test'],
|
||||
'gmailUsernames' => ['john.doe', 'jane.smith'],
|
||||
'outlookUsernames' => ['outlookuser', 'testuser'],
|
||||
'domains' => ['gmail.com', 'outlook.com', 'example.com'],
|
||||
'enable_create_from_url' => true,
|
||||
'disable_mailbox_slug' => false,
|
||||
'fetch_messages_limit' => 15,
|
||||
'blocked_domains' => ['spam.com', 'blocked.com'],
|
||||
'date_format' => 'd M Y h:i A',
|
||||
]),
|
||||
'ads_settings' => json_encode([
|
||||
'enable_ads' => false,
|
||||
'ad_provider' => 'google',
|
||||
'ad_positions' => ['header', 'sidebar', 'footer'],
|
||||
]),
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user