<?php
/**
 * Modified script to run basic functionality tests
 */

// Set error reporting
error_reporting(E_ALL);
ini_set('display_errors', 1);

// Load PHPUnit from plugin vendor directory
require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php';

// Load test bootstrap
require_once __DIR__ . '/bootstrap.php';

// Create test suite
$suite = new PHPUnit\Framework\TestSuite();

// Add test cases
$suite->addTestFile(__DIR__ . '/test-basic-functionality.php');

// Create test runner
$runner = new PHPUnit\TextUI\TestRunner();

// Run tests and get result
try {
    $result = $runner->run($suite);
    
    // Output results
    echo "\nTest Results:\n";
    echo "Tests: " . $result->count() . "\n";
    echo "Failures: " . $result->failureCount() . "\n";
    echo "Errors: " . $result->errorCount() . "\n";
    
    // Set exit code based on result
    exit($result->wasSuccessful() ? 0 : 1);
    
} catch (Exception $e) {
    echo "Error running tests: " . $e->getMessage() . "\n";
    exit(1);
}