-
-
Notifications
You must be signed in to change notification settings - Fork 233
Expand file tree
/
Copy pathbootstrap.php
More file actions
29 lines (22 loc) · 958 Bytes
/
bootstrap.php
File metadata and controls
29 lines (22 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
declare(strict_types=1);
use Faker\Factory as FakerFactory;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Zenstruck\Foundry\Object\Instantiator;
use Zenstruck\Foundry\Test\UnitTestConfig;
require dirname(__DIR__) . '/vendor/autoload.php';
if (file_exists(dirname(__DIR__) . '/config/bootstrap.php')) {
require dirname(__DIR__) . '/config/bootstrap.php';
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
new Dotenv()->bootEnv(dirname(__DIR__) . '/.env');
}
if ($_SERVER['APP_DEBUG']) {
umask(0000);
}
// https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#non-kernel-tests
UnitTestConfig::configure(instantiator: (Instantiator::withoutConstructor())
->allowExtra()
->alwaysForce(), faker: FakerFactory::create('en_GB'));
// https://github.com/symfony/symfony/issues/53812#issuecomment-1962740145
set_exception_handler([new ErrorHandler(), 'handleException']);