diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index 9b2fc1b..9e9d5fa 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -6,13 +6,16 @@ namespace Alltube\Test; +use Alltube\Config; +use Alltube\ConfigFactory; use Alltube\Controller\BaseController; use Alltube\Controller\DownloadController; use Alltube\Controller\FrontController; use Alltube\Exception\ConfigException; -use Alltube\LocaleManager; -use Alltube\LoggerFactory; +use Alltube\Exception\DependencyException; +use Alltube\LocaleManagerFactory; use Alltube\ViewFactory; +use Psr\Log\NullLogger; use Slim\Container; use Slim\Http\Environment; use Slim\Http\Request; @@ -54,6 +57,7 @@ abstract class ControllerTest extends BaseTest /** * Prepare tests. * @throws ConfigException|SmartyException + * @throws DependencyException */ protected function setUp(): void { @@ -62,9 +66,10 @@ abstract class ControllerTest extends BaseTest $this->container = new Container(); $this->request = Request::createFromEnvironment(Environment::mock()); $this->response = new Response(); - $this->container['locale'] = LocaleManager::getInstance(); + $this->container['config'] = Config::getInstance(); + $this->container['locale'] = LocaleManagerFactory::create(); $this->container['view'] = ViewFactory::create($this->container, $this->request); - $this->container['logger'] = LoggerFactory::create(); + $this->container['logger'] = new NullLogger(); $frontController = new FrontController($this->container); $downloadController = new DownloadController($this->container); diff --git a/tests/DownloadControllerTest.php b/tests/DownloadControllerTest.php index 019122b..8830d0e 100644 --- a/tests/DownloadControllerTest.php +++ b/tests/DownloadControllerTest.php @@ -9,6 +9,7 @@ namespace Alltube\Test; use Alltube\Config; use Alltube\Controller\DownloadController; use Alltube\Exception\ConfigException; +use Alltube\Exception\DependencyException; use Alltube\Library\Exception\EmptyUrlException; use Alltube\Library\Exception\RemuxException; use Alltube\Library\Exception\YoutubedlException; @@ -22,7 +23,7 @@ class DownloadControllerTest extends ControllerTest { /** * Prepare tests. - * @throws ConfigException|SmartyException + * @throws ConfigException|SmartyException|DependencyException */ protected function setUp(): void { diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index 0e2ffe0..91c4d92 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -9,6 +9,7 @@ namespace Alltube\Test; use Alltube\Config; use Alltube\Controller\FrontController; use Alltube\Exception\ConfigException; +use Alltube\Exception\DependencyException; use Alltube\Library\Exception\AlltubeLibraryException; use Exception; use Slim\Http\Environment; @@ -28,7 +29,7 @@ class FrontControllerTest extends ControllerTest /** * Prepare tests. - * @throws ConfigException|SmartyException + * @throws ConfigException|SmartyException|DependencyException */ protected function setUp(): void { diff --git a/tests/JsonControllerTest.php b/tests/JsonControllerTest.php index 438b482..1c3d254 100644 --- a/tests/JsonControllerTest.php +++ b/tests/JsonControllerTest.php @@ -8,6 +8,7 @@ namespace Alltube\Test; use Alltube\Controller\JsonController; use Alltube\Exception\ConfigException; +use Alltube\Exception\DependencyException; use Alltube\Library\Exception\YoutubedlException; use SmartyException; @@ -18,7 +19,7 @@ class JsonControllerTest extends ControllerTest { /** * Prepare tests. - * @throws ConfigException|SmartyException + * @throws ConfigException|SmartyException|DependencyException */ protected function setUp(): void {