<?php

it('registers dynamic image pre-render cron task and related helpers', function (): void {
    $content = file_get_contents(app_path('cron/Cron.php'));

    expect($content)->not->toBeFalse();
    expect($content)->toContain('PreRenderDynamicImagesCron');
    expect($content)->toContain("'interval' => 900");
    expect($content)->toContain('collectDynamicImageTaskGroupsForLane');
    expect($content)->toContain('buildDynamicImageVariantsForTaskGroup');
    expect($content)->toContain('renderDynamicImageVariant');
    expect($content)->toContain('mergeUniqueButtonValues');
    expect($content)->toContain('normalizeButtonsInput');
    expect($content)->toContain('dynamic_image:');
    expect($content)->toContain('machine_1');
    expect($content)->toContain('getSelfServeDynamicImageSizeModeForCron');
    expect($content)->toContain("'dynamic_image_size' => getSelfServeDynamicImageSizeModeForCron()");
    expect($content)->toContain('resizeToMaxWidth(DYNAMIC_IMAGE_RELEVANT_MAX_WIDTH)');
    expect($content)->toContain("\$image->exportBinary('png')");
});
