<?php

declare(strict_types=1);

$_SERVER['SCRIPT_NAME'] = '/karvi-pro/invoice/index.php';
$_SERVER['HTTP_HOST'] = 'pizzacalifornialotte.de';
$_SERVER['HTTPS'] = 'on';

require __DIR__ . '/../includes/bootstrap.php';
require __DIR__ . '/../includes/helpers.php';

$token = 'abc123def45678901234567890123456';
$url = contract_url($token);
$expected = 'https://pizzacalifornialotte.de/karvi-pro/invoice/contract/' . $token;

if ($url === $expected) {
    echo "OK contract_url\n$url\n";
    exit(0);
}

echo "FAIL contract_url\nExpected: $expected\nGot:      $url\n";
exit(1);
