mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Make Sqlite Testcases compatible with Windows / NTFS file systems
This commit is contained in:
parent
326583153a
commit
f75ebf8cb9
1 changed files with 7 additions and 1 deletions
|
@ -168,7 +168,13 @@ class SqliteTest extends CakeTestCase {
|
|||
$dbName = 'db' . rand() . '$(*%&).db';
|
||||
$this->assertFalse(file_exists(TMP . $dbName));
|
||||
|
||||
$db = new Sqlite(array_merge($this->Dbo->config, array('database' => TMP . $dbName)));
|
||||
try {
|
||||
$db = new Sqlite(array_merge($this->Dbo->config, array('database' => TMP . $dbName)));
|
||||
} catch (MissingConnectionException $e) {
|
||||
// This might be caused by NTFS file systems, where '*' is a forbidden character. Repeat without this character.
|
||||
$dbName = str_replace('*', '', $dbName);
|
||||
$db = new Sqlite(array_merge($this->Dbo->config, array('database' => TMP . $dbName)));
|
||||
}
|
||||
$this->assertTrue(file_exists(TMP . $dbName));
|
||||
|
||||
$db->execute("CREATE TABLE test_list (id VARCHAR(255));");
|
||||
|
|
Loading…
Reference in a new issue