Add a test for registering a user.
This commit is contained in:
parent
d1ffe814cc
commit
4548d67eac
@ -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);
|
||||
|
18
app/tests/Controller/User/RegisterUserActionTest.php
Normal file
18
app/tests/Controller/User/RegisterUserActionTest.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Slovocast\Tests\Controller\User;
|
||||
|
||||
use Slovocast\Tests\TestCase;
|
||||
|
||||
class RegisterUserActionTest extends TestCase
|
||||
{
|
||||
public function testSuccessfulRegistration(): void
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testFailingRegistration(): void
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user