Commit 00b3eaed authored by Tobias Schultze's avatar Tobias Schultze

fix dbal tests on windows

parent 2c789aa8
...@@ -286,9 +286,10 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -286,9 +286,10 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->markTestSkipped("Only fails this way on sqlite"); $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)) { if (file_exists($filename)) {
chmod($filename, 0200); // make the file writable again, so it can be removed on Windows
unlink($filename); unlink($filename);
} }
...@@ -314,7 +315,8 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase ...@@ -314,7 +315,8 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function getSqLiteOpenConnection() public function getSqLiteOpenConnection()
{ {
return array( 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'), array(0444, '\Doctrine\DBAL\Exception\ReadOnlyException'),
); );
} }
......
...@@ -135,6 +135,10 @@ EOS ...@@ -135,6 +135,10 @@ EOS
public function testNonDefaultPKOrder() public function testNonDefaultPKOrder()
{ {
if ( ! extension_loaded('sqlite3')) {
$this->markTestSkipped('This test requires the SQLite3 extension.');
}
$version = \SQLite3::version(); $version = \SQLite3::version();
if(version_compare($version['versionString'], '3.7.16', '<')) { if(version_compare($version['versionString'], '3.7.16', '<')) {
$this->markTestSkipped('This version of sqlite doesn\'t return the order of the Primary Key.'); $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