File: /home/xedaptot/be.naniguide.com/tests/Feature/CampaignFlowFeatureTest.php
<?php
/**
* Campaign business logic feature tests.
*/
use App\Model\Campaign;
test('campaign status constants are defined', function () {
expect(Campaign::STATUS_NEW)->toBe('new');
expect(Campaign::STATUS_SENDING)->toBe('sending');
expect(Campaign::STATUS_DONE)->toBe('done');
expect(Campaign::STATUS_QUEUED)->toBe('queued');
expect(Campaign::STATUS_SCHEDULED)->toBe('scheduled');
});
test('campaign has required fillable fields', function () {
$campaign = new Campaign();
$fillable = $campaign->getFillable();
expect($fillable)->toContain('name');
expect($fillable)->toContain('subject');
expect($fillable)->toContain('from_email');
expect($fillable)->toContain('from_name');
expect($fillable)->toContain('reply_to');
});
test('campaign model can be instantiated with attributes', function () {
$campaign = new Campaign([
'name' => 'Spring Sale 2026',
'subject' => 'Big Savings Inside!',
'from_email' => '[email protected]',
'from_name' => 'Sales Team',
'reply_to' => '[email protected]',
]);
$campaign->status = Campaign::STATUS_NEW;
expect($campaign->name)->toBe('Spring Sale 2026');
expect($campaign->subject)->toBe('Big Savings Inside!');
expect($campaign->status)->toBe(Campaign::STATUS_NEW);
});