diff --git a/app/src/Bootstrap.php b/app/src/Bootstrap.php index ee0442c..2de0523 100644 --- a/app/src/Bootstrap.php +++ b/app/src/Bootstrap.php @@ -4,15 +4,24 @@ namespace Slovocast; use Slim\App; use Slim\Factory\AppFactory; + use League\Config\Configuration; + use DI\Container; use DI\ContainerBuilder; + use Slim\Views\Twig; use Slim\Views\TwigMiddleware; + use Slovocast\Routes; use Slovocast\Configuration\SiteInformationSchema; use Slovocast\Configuration\DatabaseConnectionSchema; +use Psr\Log\LoggerInterface; +use Monolog\Logger; +use Monolog\Handler\StreamHandler; +use Monolog\Level; + class Bootstrap { /** @@ -58,6 +67,13 @@ class Bootstrap 'flash' => function () { $messages = []; return new \Slim\Flash\Messages($messages); + }, + LoggerInterface::class => function() { + $logger = new Logger(); + $logger->pushHandler( + new StreamHandler(__DIR__ . '/var/logs', Level::Warning) + ); + return $logger; } ]); @@ -108,6 +124,7 @@ class Bootstrap session_start(); } + /** @var $this ContainerInterface */ $this->get('flash')->__construct($_SESSION); return $next->handle($req); diff --git a/app/tests/Controller/User/RegisterUserActionTest.php b/app/tests/Controller/User/RegisterUserActionTest.php new file mode 100644 index 0000000..018b40b --- /dev/null +++ b/app/tests/Controller/User/RegisterUserActionTest.php @@ -0,0 +1,18 @@ +