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:
40
database/factories/PremiumEmailFactory.php
Normal file
40
database/factories/PremiumEmailFactory.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\PremiumEmail>
|
||||
*/
|
||||
class PremiumEmailFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => 1,
|
||||
'message_id' => fake()->unique()->numerify('msg##########'),
|
||||
'subject' => fake()->sentence(),
|
||||
'from_name' => fake()->name(),
|
||||
'from_email' => fake()->email(),
|
||||
'to' => [fake()->email()],
|
||||
'cc' => [],
|
||||
'bcc' => [],
|
||||
'timestamp' => fake()->dateTime(),
|
||||
'body_text' => fake()->paragraph(),
|
||||
'body_html' => fake()->randomHtml(),
|
||||
'is_seen' => fake()->boolean(),
|
||||
'is_flagged' => fake()->boolean(),
|
||||
'size' => fake()->numberBetween(100, 10000),
|
||||
'mailbox' => 'INBOX',
|
||||
'raw_headers' => null,
|
||||
'raw_body' => null,
|
||||
'attachments' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user