diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-22 21:31:30 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-22 21:31:30 -0400 |
commit | 9707c0b4c4145b9fbdab3a2ecb40c92633dacab1 (patch) | |
tree | 126918a559d09d5e1bda51f5baf520e399c3c10f /tests/units/Base.php | |
parent | 5d1507522366e51be79813fd5a0c80e96001a964 (diff) |
Make unit tests pass under Windows
Diffstat (limited to 'tests/units/Base.php')
-rw-r--r-- | tests/units/Base.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/units/Base.php b/tests/units/Base.php index 89d0e2bf..8112c954 100644 --- a/tests/units/Base.php +++ b/tests/units/Base.php @@ -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'; + } } |