<?php

it('does not query subscription-applied transactions with an empty eligible order list', function (): void {
    $content = file_get_contents(dirname(__DIR__, 3) . '/objects/customer_vehicles_o.php');

    expect($content)->not->toBeFalse();
    $content = (string)$content;

    expect($content)
        ->toContain('$orders = [];')
        ->toMatch('/\$orders\[\] = \(int\)\$transaction_id;\s*}\s*if \(empty\(\$orders\)\) {\s*return \[\];\s*}\s*\$order_ids = implode/s')
        ->toContain('AND o.id IN ($order_ids)')
        ->not->toContain('rtrim($orders, \',\')')
        ->not->toContain('AND o.id IN ($orders)');
});
