Skip to content

Commit fd0e82b

Browse files
committed
fixing test
1 parent 208d92e commit fd0e82b

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

tests/Pest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,23 @@
1212
function db($uuid = 'ID')
1313
{
1414
$useUUID = 'UUID' == $uuid;
15-
$factory = new Scrawler\Arca\Factory\DatabaseFactory();
16-
static $dbUUID = $factory->build(connectionParams: getConnectionParams('UUID'));
17-
static $dbID = $factory->build(connectionParams: getConnectionParams('ID'));
15+
static $dbUUID = null;
16+
static $dbID = null;
17+
static $factory = null;
1818

19+
if ($factory === null) {
20+
$factory = new Scrawler\Arca\Factory\DatabaseFactory();
21+
}
1922

2023
if ($useUUID) {
24+
if ($dbUUID === null) {
25+
$dbUUID = $factory->build(connectionParams: getConnectionParams('UUID'));
26+
}
2127
return $dbUUID;
2228
} else {
29+
if ($dbID === null) {
30+
$dbID = $factory->build(connectionParams: getConnectionParams('ID'));
31+
}
2332
return $dbID;
2433
}
2534
}

0 commit comments

Comments
 (0)