Skip to content

Commit

Permalink
Make Sqlite Testcases compatible with Windows / NTFS file systems
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusBauer committed May 18, 2016
1 parent 3265831 commit f75ebf8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ public function testCacheKeyName() {
$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));");
Expand Down

0 comments on commit f75ebf8

Please sign in to comment.