Add repo hygiene rules and ignore secrets
This commit is contained in:
27
server/tests/Support/TestAppFactory.php
Normal file
27
server/tests/Support/TestAppFactory.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Support;
|
||||
|
||||
use App\Bootstrap;
|
||||
use App\Config\ConfigLoader;
|
||||
use App\Config\ConfigValidator;
|
||||
use App\Shared\Clock\TimeProvider;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Slim\App;
|
||||
|
||||
final class TestAppFactory
|
||||
{
|
||||
public static function create(\PDO $pdo, TimeProvider $timeProvider): App
|
||||
{
|
||||
$repoRoot = dirname(__DIR__, 3);
|
||||
$container = Bootstrap::buildContainer([
|
||||
\PDO::class => $pdo,
|
||||
TimeProvider::class => $timeProvider,
|
||||
ConfigLoader::class => new ConfigLoader(new ConfigValidator(), $repoRoot . '/config'),
|
||||
]);
|
||||
|
||||
return Bootstrap::createApp($container);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user