diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-13 23:13:52 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-13 23:13:52 +0200 |
commit | 7faa40dc59738fc4b5bb9dd2121e433e2301c36b (patch) | |
tree | 2eac772fb6e39eebbf4349760f5757c6b2547ecf /tests/unit/utility/ConfigTest.php | |
parent | f333f6b38f985c40247f7c82dd462f3016611dfe (diff) |
fix some tests
Diffstat (limited to 'tests/unit/utility/ConfigTest.php')
-rw-r--r-- | tests/unit/utility/ConfigTest.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/unit/utility/ConfigTest.php b/tests/unit/utility/ConfigTest.php index 186177489..8c1bee0f0 100644 --- a/tests/unit/utility/ConfigTest.php +++ b/tests/unit/utility/ConfigTest.php @@ -16,15 +16,16 @@ namespace OCA\News\Utility; require_once(__DIR__ . "/../../classloader.php"); -class ConfigFetcherTest extends \PHPUnit_Framework_TestCase { +class ConfigTest extends \PHPUnit_Framework_TestCase { private $fileSystem; private $config; private $configPath; + private $loggerParams; public function setUp() { $this->logger = $this->getMockBuilder( - '\OCA\News\Core\Logger') + '\OCP\ILogger') ->disableOriginalConstructor() ->getMock(); $this->fileSystem = $this->getMock('FileSystem', array( @@ -32,7 +33,8 @@ class ConfigFetcherTest extends \PHPUnit_Framework_TestCase { 'file_put_contents', 'file_exists' )); - $this->config = new Config($this->fileSystem, $this->logger); + $this->loggerParams = array('hi'); + $this->config = new Config($this->fileSystem, $this->logger, $this->loggerParams); $this->configPath = 'config.json'; } @@ -83,10 +85,10 @@ class ConfigFetcherTest extends \PHPUnit_Framework_TestCase { ->with($this->equalTo($this->configPath)) ->will($this->returnValue('autoPurgeCounts = 3')); $this->logger->expects($this->once()) - ->method('log') + ->method('warning') ->with($this->equalTo('Configuration value "autoPurgeCounts" ' . 'does not exist. Ignored value.'), - $this->equalTo('warn')); + $this->equalTo($this->loggerParams)); $this->config->read($this->configPath); } @@ -98,9 +100,9 @@ class ConfigFetcherTest extends \PHPUnit_Framework_TestCase { ->with($this->equalTo($this->configPath)) ->will($this->returnValue('')); $this->logger->expects($this->once()) - ->method('log') + ->method('warning') ->with($this->equalTo('Configuration invalid. Ignoring values.'), - $this->equalTo('warn')); + $this->equalTo($this->loggerParams)); $this->config->read($this->configPath); } |