diff --git a/app/bootstrap.php b/app/bootstrap.php index f12127c2..627fb5c7 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -32,8 +32,11 @@ use Monolog\Handler\RotatingFileHandler; use Monolog\Logger; use Psr\SimpleCache\CacheInterface; -define('APP_DIR', __DIR__); -define('TEMPLATE_DIR', APP_DIR . '/templates'); +if ( ! defined('APP_DIR')) +{ + define('APP_DIR', __DIR__); + define('TEMPLATE_DIR', APP_DIR . '/templates'); +} // ----------------------------------------------------------------------------- // Setup DI container diff --git a/tests/AnimeClient/FormGeneratorTest.php b/tests/AnimeClient/FormGeneratorTest.php index 89f22220..fae6980e 100644 --- a/tests/AnimeClient/FormGeneratorTest.php +++ b/tests/AnimeClient/FormGeneratorTest.php @@ -252,12 +252,12 @@ class FormGeneratorTest extends AnimeClientTestCase { { parent::setUp(); - $this->generator = new FormGenerator($this->container); + $this->generator = FormGenerator::new($this->container); } public function testSanity(): void { - $generator = new FormGenerator($this->container); + $generator = FormGenerator::new($this->container); $this->assertInstanceOf(FormGenerator::class, $generator); } diff --git a/tests/AnimeClient/MenuGeneratorTest.php b/tests/AnimeClient/MenuGeneratorTest.php index 5b8f5d5e..254fff50 100644 --- a/tests/AnimeClient/MenuGeneratorTest.php +++ b/tests/AnimeClient/MenuGeneratorTest.php @@ -26,12 +26,12 @@ class MenuGeneratorTest extends AnimeClientTestCase { public function setUp(): void { parent::setUp(); - $this->generator = new MenuGenerator($this->container); + $this->generator = MenuGenerator::new($this->container); } public function testSanity() { - $generator = new MenuGenerator($this->container); + $generator = MenuGenerator::new($this->container); $this->assertInstanceOf(MenuGenerator::class, $generator); } diff --git a/tests/Ion/di.php b/tests/Ion/di.php index 13caf6f0..cf1ecba5 100644 --- a/tests/Ion/di.php +++ b/tests/Ion/di.php @@ -40,9 +40,8 @@ return static function(array $config_array = []) { }); // Create Html helper Object - $container->set('html-helper', static function() { - return (new HelperLocatorFactory)->newInstance(); - }); + $container->set('html-helper', fn() => (new HelperLocatorFactory)->newInstance()); + $container->set('component-helper', fn() => (new HelperLocatorFactory)->newInstance()); return $container; }; \ No newline at end of file