#!/bin/bash

# Script para executar todos os testes

echo "🚀 Iniciando testes automatizados..."
echo ""

# Verificar se PHPUnit está instalado
if [ ! -f "vendor/bin/phpunit" ]; then
    echo "❌ PHPUnit não encontrado. Instalando dependências..."
    composer install
fi

# Executar testes
echo "📋 Executando testes..."
echo ""

# Testes Core
echo "🔍 Testes Core..."
vendor/bin/phpunit tests/Core --colors=always

# Testes Modules
echo "🔍 Testes Modules..."
vendor/bin/phpunit tests/Modules --colors=always

# Testes Integration
echo "🔍 Testes Integration..."
vendor/bin/phpunit tests/Integration --colors=always

# Testes Unit
echo "🔍 Testes Unit..."
vendor/bin/phpunit tests/Unit --colors=always

# Todos os testes
echo "🔍 Todos os testes..."
vendor/bin/phpunit --colors=always

echo ""
echo "✅ Testes concluídos!"
echo ""
echo "📊 Para gerar relatório de cobertura:"
echo "   composer test-coverage"

