Skip to content

Commit b250ea8

Browse files
committed
tests: added getTempDir()
1 parent 1c37d95 commit b250ea8

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

tests/Database/Explorer/bugs/bug216.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ try {
2121
}
2222

2323
if (strpos($options['dsn'], 'sqlite::memory:') === false) {
24-
Tester\Environment::lock($options['dsn'], TEMP_DIR);
24+
Tester\Environment::lock($options['dsn'], getTempDir());
2525
}
2626

2727
$driverName = $connection->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);

tests/Database/connect.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919

2020
if (strpos($options['dsn'], 'sqlite::memory:') === false) {
21-
Tester\Environment::lock($options['dsn'], TEMP_DIR);
21+
Tester\Environment::lock($options['dsn'], getTempDir());
2222
}
2323

2424
$driverName = $connection->getPdo()->getAttribute(PDO::ATTR_DRIVER_NAME);

tests/bootstrap.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
date_default_timezone_set('Europe/Prague');
1717

1818

19-
// create temporary directory
20-
define('TEMP_DIR', __DIR__ . '/tmp');
21-
@mkdir(dirname(TEMP_DIR));
22-
@mkdir(TEMP_DIR);
19+
function getTempDir(): string
20+
{
21+
$dir = __DIR__ . '/tmp';
22+
@mkdir($dir);
23+
return $dir;
24+
}
2325

2426

2527
function before(?Closure $function = null)

0 commit comments

Comments
 (0)