Merge pull request #8851 from MarkusBauer/v2.x/SqliteTestEnhancements

Sqlite testcase enhancements
This commit is contained in:
Mark Story 2016-05-18 22:01:33 -04:00
commit 0fd3ad9b76

View file

@ -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));");
@ -500,6 +506,7 @@ SQL;
* @return void
*/
public function testNestedTransaction() {
$this->Dbo->useNestedTransactions = true;
$this->skipIf($this->Dbo->nestedTransactionSupported() === false, 'The Sqlite version do not support nested transaction');
$this->loadFixtures('User');