Commit e4c143f0 authored by Steve Müller's avatar Steve Müller Committed by GitHub

Merge pull request #911 from Tobion/fix-tests-on-windows

fix dbal tests on windows
parents b6b247a3 00b3eaed
......@@ -286,9 +286,10 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->markTestSkipped("Only fails this way on sqlite");
}
$filename = sprintf('%s/%s', sys_get_temp_dir(), 'doctrine_failed_connection.db');
$filename = sprintf('%s/%s', sys_get_temp_dir(), 'doctrine_failed_connection_'.$mode.'.db');
if (file_exists($filename)) {
chmod($filename, 0200); // make the file writable again, so it can be removed on Windows
unlink($filename);
}
......@@ -314,7 +315,8 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function getSqLiteOpenConnection()
{
return array(
array(0000, '\Doctrine\DBAL\Exception\ConnectionException'),
// mode 0 is considered read-only on Windows
array(0000, defined('PHP_WINDOWS_VERSION_BUILD') ? '\Doctrine\DBAL\Exception\ReadOnlyException' : '\Doctrine\DBAL\Exception\ConnectionException'),
array(0444, '\Doctrine\DBAL\Exception\ReadOnlyException'),
);
}
......
......@@ -136,6 +136,10 @@ EOS
public function testNonDefaultPKOrder()
{
if ( ! extension_loaded('sqlite3')) {
$this->markTestSkipped('This test requires the SQLite3 extension.');
}
$version = \SQLite3::version();
if(version_compare($version['versionString'], '3.7.16', '<')) {
$this->markTestSkipped('This version of sqlite doesn\'t return the order of the Primary Key.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment