<?php

declare(strict_types=1);

require_once __DIR__ . '/../../vendor/autoload.php';

use App\Framework\Console\ConsoleInput;
use App\Framework\WebPush\Console\VapidKeyCommands;
use App\Framework\WebPush\Services\VapidKeyGenerator;

echo "=== VAPID Console Command Test ===\n\n";

$generator = new VapidKeyGenerator();
$commands = new VapidKeyCommands($generator);

// Test 1: Generate with default format (env)
echo "Test 1: Generate VAPID Keys (.env format)\n\n";
$input = new ConsoleInput([]);
$exitCode = $commands->generate($input);
echo "\nExit Code: {$exitCode}\n\n";

// Test 2: Generate with JSON format
echo "Test 2: Generate VAPID Keys (JSON format)\n\n";
$input = new ConsoleInput(['--format=json']);
$exitCode = $commands->generate($input);
echo "\nExit Code: {$exitCode}\n\n";

// Test 3: Generate with Table format
echo "Test 3: Generate VAPID Keys (Table format)\n\n";
$input = new ConsoleInput(['--format=table']);
$exitCode = $commands->generate($input);
echo "\nExit Code: {$exitCode}\n\n";

echo "=== Command Tests Completed! ✅ ===\n";
