You've already forked Php-Template
All checks were successful
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 1m55s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 1m56s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 2m10s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 1m56s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 2m45s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 53s
Reviewed-on: #6 Co-authored-by: Ron Rise <ron@siteworxpro.com> Co-committed-by: Ron Rise <ron@siteworxpro.com>
33 lines
821 B
PHP
33 lines
821 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Siteworxpro\Tests\Facades;
|
|
|
|
use Siteworxpro\App\Services\Facade;
|
|
use Siteworxpro\Tests\Unit;
|
|
|
|
abstract class AbstractFacade extends Unit
|
|
{
|
|
abstract protected function getFacadeClass(): string;
|
|
abstract protected function getConcrete(): string;
|
|
|
|
public function testFacadeAccessor(): void
|
|
{
|
|
/** @var Facade | string $class */
|
|
$class = $this->getFacadeClass();
|
|
|
|
$this->assertTrue(
|
|
method_exists($class, 'getFacadeAccessor'),
|
|
sprintf('The class %s must implement the method getFacadeAccessor.', $class)
|
|
);
|
|
|
|
$facade = $class::getFacadeRoot();
|
|
|
|
$this->assertNotNull(
|
|
$facade,
|
|
sprintf('The facade %s is not properly initialized.', $this->getConcrete())
|
|
);
|
|
}
|
|
}
|