HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
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]');
});