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/AdMetricFeatureTest.php
<?php

use App\Model\AdMetric;

test('ad metric fillable fields are correct', function () {
    $metric = new AdMetric();
    expect($metric->getFillable())->toContain('ad_campaign_id', 'platform', 'date', 'impressions', 'clicks', 'spend', 'conversions', 'ctr', 'cpc', 'cpm', 'roas', 'custom');
});

test('ad metric casts are correct', function () {
    $metric = new AdMetric();
    $casts = $metric->getCasts();
    expect($casts['date'])->toBe('date');
    expect($casts['impressions'])->toBe('integer');
    expect($casts['clicks'])->toBe('integer');
    expect($casts['spend'])->toBe('decimal:2');
    expect($casts['ctr'])->toBe('decimal:4');
    expect($casts['custom'])->toBe('json');
});