File: /home/xedaptot/be.naniguide.com/tests/Feature/SubscriberModelFeatureTest.php
<?php
/**
* Subscriber model feature tests.
*/
use App\Model\Subscriber;
test('subscriber status constants are defined', function () {
expect(Subscriber::STATUS_SUBSCRIBED)->toBe('subscribed');
expect(Subscriber::STATUS_UNSUBSCRIBED)->toBe('unsubscribed');
expect(Subscriber::STATUS_BLACKLISTED)->toBe('blacklisted');
});
test('subscriber subscription type constants are defined', function () {
expect(Subscriber::SUBSCRIPTION_TYPE_ADDED)->toBe('added');
expect(Subscriber::SUBSCRIPTION_TYPE_IMPORTED)->toBe('imported');
});
test('subscriber has fillable email field', function () {
$subscriber = new Subscriber();
$fillable = $subscriber->getFillable();
expect($fillable)->toContain('email');
expect($fillable)->toContain('mail_list_id');
});
test('subscriber model accepts email via mass assignment', function () {
$subscriber = new Subscriber([
'email' => '[email protected]',
]);
expect($subscriber->email)->toBe('[email protected]');
});