From 9315f0c6de183eeeef620d21cab393f88b8fce5e Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 2 Sep 2013 17:24:45 +0200 Subject: typecast config values to default values of config object --- tests/unit/utility/ConfigTest.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit/utility/ConfigTest.php b/tests/unit/utility/ConfigTest.php index 455abf810..479acabb5 100644 --- a/tests/unit/utility/ConfigTest.php +++ b/tests/unit/utility/ConfigTest.php @@ -66,8 +66,21 @@ class ConfigFetcherTest extends \OCA\AppFramework\Utility\TestUtility { $this->config->read($this->configPath); - $this->assertEquals(3, $this->config->getAutoPurgeCount()); - $this->assertEquals(true, $this->config->getUseCronUpdates()); + $this->assertTrue(3 === $this->config->getAutoPurgeCount()); + $this->assertTrue(true === $this->config->getUseCronUpdates()); + } + + + public function testReadBool () { + $this->fileSystem->expects($this->once()) + ->method('file_get_contents') + ->with($this->equalTo($this->configPath)) + ->will($this->returnValue("autoPurgeCount = 3\nuseCronUpdates = false")); + + $this->config->read($this->configPath); + + $this->assertTrue(3 === $this->config->getAutoPurgeCount()); + $this->assertTrue(false === $this->config->getUseCronUpdates()); } -- cgit v1.2.3