-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpunit-bootstrap.php
More file actions
26 lines (19 loc) · 793 Bytes
/
phpunit-bootstrap.php
File metadata and controls
26 lines (19 loc) · 793 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
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
use Brick\Lock\Tests\Util\LockDriverFactory;
use Brick\Lock\Tests\Util\LockDriverFactoryException;
// Even though lock drivers are used in the worker script only, we try to instantiate the driver here first:
// - if the driver cannot be created, we can display error messages early, before the tests start;
// - if the driver can be created, we can display informational messages, e.g., the database version.
try {
$lockDriverWithInfo = LockDriverFactory::getDriver();
} catch (LockDriverFactoryException $e) {
foreach ($e->errorMessages as $errorMessage) {
echo $errorMessage, PHP_EOL;
}
exit(1);
}
foreach ($lockDriverWithInfo->infoMessages as $infoMessage) {
echo $infoMessage, PHP_EOL;
}