diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-19 13:20:54 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-19 13:21:11 +0200 |
commit | 517e4ca5435106ab5304849248cbea4e9dffd4b0 (patch) | |
tree | 0f00076f012791b39c710994f695abf723546062 /tests/unit/utility | |
parent | bd35b98d2c130f058b182f726636ee971625823b (diff) |
split up api class for easier testing and clearer code
Diffstat (limited to 'tests/unit/utility')
-rw-r--r-- | tests/unit/utility/ConfigTest.php | 12 | ||||
-rw-r--r-- | tests/unit/utility/OPMLExporterTest.php | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/unit/utility/ConfigTest.php b/tests/unit/utility/ConfigTest.php index a2b871c76..8dd64ac7b 100644 --- a/tests/unit/utility/ConfigTest.php +++ b/tests/unit/utility/ConfigTest.php @@ -28,15 +28,15 @@ namespace OCA\News\Utility; require_once(__DIR__ . "/../../classloader.php"); -class ConfigFetcherTest extends \OCA\News\Utility\TestUtility { +class ConfigFetcherTest extends \PHPUnit_Framework_TestCase { private $fileSystem; private $config; private $configPath; public function setUp() { - $this->api = $this->getMockBuilder( - '\OCA\News\Core\API') + $this->logger = $this->getMockBuilder( + '\OCA\News\Core\Logger') ->disableOriginalConstructor() ->getMock(); $this->fileSystem = $this->getMock('FileSystem', array( @@ -44,7 +44,7 @@ class ConfigFetcherTest extends \OCA\News\Utility\TestUtility { 'file_put_contents', 'file_exists' )); - $this->config = new Config($this->fileSystem, $this->api); + $this->config = new Config($this->fileSystem, $this->logger); $this->configPath = 'config.json'; } @@ -94,7 +94,7 @@ class ConfigFetcherTest extends \OCA\News\Utility\TestUtility { ->method('file_get_contents') ->with($this->equalTo($this->configPath)) ->will($this->returnValue('autoPurgeCounts = 3')); - $this->api->expects($this->once()) + $this->logger->expects($this->once()) ->method('log') ->with($this->equalTo('Configuration value "autoPurgeCounts" ' . 'does not exist. Ignored value.'), @@ -109,7 +109,7 @@ class ConfigFetcherTest extends \OCA\News\Utility\TestUtility { ->method('file_get_contents') ->with($this->equalTo($this->configPath)) ->will($this->returnValue('')); - $this->api->expects($this->once()) + $this->logger->expects($this->once()) ->method('log') ->with($this->equalTo('Configuration invalid. Ignoring values.'), $this->equalTo('warn')); diff --git a/tests/unit/utility/OPMLExporterTest.php b/tests/unit/utility/OPMLExporterTest.php index cf20f6347..eb9384f27 100644 --- a/tests/unit/utility/OPMLExporterTest.php +++ b/tests/unit/utility/OPMLExporterTest.php @@ -31,7 +31,7 @@ use \OCA\News\Db\Feed; require_once(__DIR__ . "/../../classloader.php"); -class OPMLExporterTest extends \OCA\News\Utility\TestUtility { +class OPMLExporterTest extends \PHPUnit_Framework_TestCase { private $exporter; private $feed1; |