#!/bin/bash

# Route Health Check Test Runner
# Runs automated tests to verify all major routes are working

set -e

echo "🧪 Running Xeek Route Health Check Tests..."
echo ""

# Check if PHPUnit is installed
if [ ! -f "vendor/bin/phpunit" ]; then
    echo "📦 PHPUnit not found. Installing dependencies..."
    COMPOSER_ALLOW_SUPERUSER=1 composer install --dev > /dev/null 2>&1
fi

# Run tests
php -d memory_limit=512M ./vendor/bin/phpunit tests/Feature/RouteHealthCheckTest.php --testdox

echo ""
echo "✅ Test run complete!"
