Make unit tests pass under Windows

This commit is contained in:
Frederic Guillot
2015-10-22 21:31:30 -04:00
parent 5d15075223
commit 9707c0b4c4
7 changed files with 48 additions and 29 deletions

View File

@@ -84,7 +84,7 @@ abstract class Base extends PHPUnit_Framework_TestCase
$this->container['db']->logQueries = true;
$this->container['logger'] = new Logger;
$this->container['logger']->setLogger(new File('/dev/null'));
$this->container['logger']->setLogger(new File($this->isWindows() ? 'NUL' : '/dev/null'));
$this->container['httpClient'] = new FakeHttpClient;
$this->container['emailClient'] = $this->getMockBuilder('EmailClient')->setMethods(array('send'))->getMock();
@@ -99,4 +99,9 @@ abstract class Base extends PHPUnit_Framework_TestCase
{
$this->container['db']->closeConnection();
}
public function isWindows()
{
return substr(PHP_OS, 0, 3) === 'WIN';
}
}