summaryrefslogtreecommitdiffstats
path: root/tests/lib/config.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-02 00:15:42 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-02 00:15:42 +0200
commite789e056759aedb93d9eba3a8598acea67c842c6 (patch)
tree584c24d7f31292ec054a3769353e450e58eb4681 /tests/lib/config.php
parentbb07dde9881368f5727133b73f6017deae4ff18d (diff)
downloadnextcloud-server-e789e056759aedb93d9eba3a8598acea67c842c6.tar.gz
nextcloud-server-e789e056759aedb93d9eba3a8598acea67c842c6.zip
on unit test use @expectedException
some phpdoc added
Diffstat (limited to 'tests/lib/config.php')
-rw-r--r--tests/lib/config.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/lib/config.php b/tests/lib/config.php
index 8f52cf4ae76..c17d2ae7eff 100644
--- a/tests/lib/config.php
+++ b/tests/lib/config.php
@@ -11,6 +11,11 @@ class Test_Config extends PHPUnit_Framework_TestCase {
const CONFIG_DIR = 'static://';
const TESTCONTENT = '<?php $CONFIG=array("foo"=>"bar");';
+ /**
+ * @var \OC\Config
+ */
+ private $config;
+
function setUp() {
file_put_contents(self::CONFIG_FILE, self::TESTCONTENT);
$this->config = new OC\Config(self::CONFIG_DIR);
@@ -94,14 +99,12 @@ EOL
, $content);
}
+ /**
+ * @expectedException \OC\HintException
+ */
public function testWriteData()
{
$config = new OC\Config('/non-writable');
- try {
- $config->setValue('foo', 'bar');
- } catch (\OC\HintException $e) {
- return;
- }
- $this->fail();
+ $config->setValue('foo', 'bar');
}
}