# Test completo: Buque genera "hola" y servidor lo recibe
# Uso: .\test_buque_hola_completo.ps1

Write-Host "===========================================" -ForegroundColor Cyan
Write-Host "Test: Buque genera 'hola' y Servidor recibe" -ForegroundColor Cyan
Write-Host "===========================================" -ForegroundColor Cyan
Write-Host ""

$phpPath = "C:\xampp\php\php.exe"

if (-not (Test-Path $phpPath)) {
    Write-Host "❌ Error: PHP no encontrado" -ForegroundColor Red
    exit 1
}

Write-Host "Paso 1: BUQUE genera archivo TXT con 'hola'..." -ForegroundColor Yellow
Write-Host ""
& $phpPath buque_genera_hola.php
Write-Host ""

Write-Host "Paso 2: SERVIDOR recibe y analiza el archivo..." -ForegroundColor Yellow
Write-Host ""
& $phpPath servidor_procesa_archivo.php
Write-Host ""

Write-Host "===========================================" -ForegroundColor Green
Write-Host "✅ Test completado!" -ForegroundColor Green
Write-Host "===========================================" -ForegroundColor Green
Write-Host ""
Write-Host "El servidor RECIBIÓ el archivo del buque." -ForegroundColor Cyan
Write-Host "El contenido 'hola' no es formato válido, pero el sistema lo detectó." -ForegroundColor Yellow
Write-Host ""

