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

29 lines
1.2 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
use Illuminate\Console\Scheduling\Schedule;
it('registers advertising Direct jobs in the scheduler', function () {
$events = app(Schedule::class)->events();
$summaries = array_map(fn ($e) => $e->getSummaryForDisplay(), $events);
$joined = implode("\n", $summaries);
expect($joined)->toContain('ChargeCampaignSpendJob')
->and($joined)->toContain('SyncCampaignAudienceJob')
->and($joined)->toContain('SyncCampaignModerationJob');
});
/**
* Сторож очереди робота обязан быть в расписании.
*
* Сама команда без расписания бесполезна: зависшее «в работе» задание держит очередь для
* ВСЕХ клиентов, а разбирать пробку руками некому — робот работает по ночам без людей.
*/
it('registers the creative job reaper in the scheduler', function () {
$events = app(Schedule::class)->events();
$joined = implode("\n", array_map(fn ($e) => $e->getSummaryForDisplay(), $events));
expect($joined)->toContain('creative-jobs:reap');
});