- Add comprehensive error handling system with custom error pages - Implement professional enterprise-style design with Tailwind CSS - Create modular HMVC architecture with clean separation of concerns - Add security features: CSRF protection, XSS filtering, Argon2ID hashing - Include CLI tools for development workflow - Add error reporting dashboard with system monitoring - Implement responsive design with consistent slate color scheme - Replace all emoji icons with professional SVG icons - Add comprehensive test suite with PHPUnit - Include database migrations and seeders - Add proper exception handling with fallback pages - Implement template engine with custom syntax support - Add helper functions and facades for clean code - Include proper logging and debugging capabilities
66 lines
1.4 KiB
PHP
66 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use PHPUnit\Framework\TestCase as BaseTestCase;
|
|
use App\Core\Bootstrap;
|
|
use App\Core\Container;
|
|
|
|
/**
|
|
* Base test case for NovaCore Framework
|
|
*/
|
|
abstract class TestCase extends BaseTestCase
|
|
{
|
|
protected ?Container $container = null;
|
|
protected ?Bootstrap $bootstrap = null;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
// Set up test environment
|
|
putenv('APP_ENV=testing');
|
|
putenv('APP_DEBUG=true');
|
|
|
|
// Initialize container and bootstrap
|
|
$this->container = new Container();
|
|
$this->bootstrap = new Bootstrap();
|
|
}
|
|
|
|
protected function tearDown(): void
|
|
{
|
|
parent::tearDown();
|
|
|
|
// Clean up
|
|
$this->container = null;
|
|
$this->bootstrap = null;
|
|
}
|
|
|
|
/**
|
|
* Create a test request
|
|
*/
|
|
protected function createRequest(array $data = [], string $method = 'GET'): void
|
|
{
|
|
$_SERVER['REQUEST_METHOD'] = $method;
|
|
$_GET = $data;
|
|
$_POST = $method === 'POST' ? $data : [];
|
|
$_REQUEST = array_merge($_GET, $_POST);
|
|
}
|
|
|
|
/**
|
|
* Assert that response contains text
|
|
*/
|
|
protected function assertResponseContains(string $content, string $text): void
|
|
{
|
|
$this->assertStringContainsString($text, $content);
|
|
}
|
|
|
|
/**
|
|
* Assert that response is JSON
|
|
*/
|
|
protected function assertJsonResponse(string $content): void
|
|
{
|
|
$this->assertJson($content);
|
|
}
|
|
}
|