2026-07-26 23:41:48 +03:00
|
|
|
<?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 () {
|
2026-07-29 16:41:38 +03:00
|
|
|
$campaign = new AdCampaign;
|
2026-07-26 23:41:48 +03:00
|
|
|
$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();
|
|
|
|
|
});
|