Files
Php-Template/tests/Unit.php
Ron Rise 54c656551e
Some checks failed
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Has started running
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Has been cancelled
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Has been cancelled
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Has been cancelled
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Has been cancelled
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Has been cancelled
feat: add abstract classes for controllers, facades, and service providers with unit tests
2025-10-15 19:44:57 -04:00

34 lines
751 B
PHP

<?php
declare(strict_types=1);
namespace Siteworxpro\Tests;
use Illuminate\Container\Container;
use PHPUnit\Framework\TestCase;
use Siteworx\Config\Config as SWConfig;
use Siteworxpro\App\Services\Facade;
use Siteworxpro\App\Services\Facades\Config;
abstract class Unit extends TestCase
{
/**
* @throws \ReflectionException
*/
protected function setUp(): void
{
$container = new Container();
Facade::setFacadeContainer($container);
$container->bind(SWConfig::class, function () {
return SWConfig::load(__DIR__ . '/../config.php');
});
}
protected function tearDown(): void
{
Config::clearResolvedInstances();
Facade::setFacadeContainer(null);
}
}