Files
portal/app/tests/Feature/Advertising/AdCampaignCreativeIdMigrationTest.php
T

20 lines
739 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
use App\Models\AdCampaign;
use Illuminate\Support\Facades\Schema;
it('добавляет yandex_creative_id в ad_campaigns как nullable', function () {
expect(Schema::hasColumn('ad_campaigns', 'yandex_creative_id'))->toBeTrue();
});
it('модель AdCampaign позволяет задать и прочитать yandex_creative_id как integer', function () {
$campaign = new AdCampaign;
$campaign->fill(['yandex_creative_id' => '123456789']);
expect($campaign->yandex_creative_id)->toBe(123456789)
->and($campaign->getCasts()['yandex_creative_id'] ?? null)->toBe('integer')
->and(in_array('yandex_creative_id', $campaign->getFillable(), true))->toBeTrue();
});