parent
bb07dde988
commit
e789e05675
|
@ -41,6 +41,9 @@
|
||||||
OC_Config::$object = new \OC\Config(OC::$SERVERROOT.'/config/');
|
OC_Config::$object = new \OC\Config(OC::$SERVERROOT.'/config/');
|
||||||
class OC_Config {
|
class OC_Config {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \OC\Config
|
||||||
|
*/
|
||||||
public static $object;
|
public static $object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,6 +11,11 @@ class Test_Config extends PHPUnit_Framework_TestCase {
|
||||||
const CONFIG_DIR = 'static://';
|
const CONFIG_DIR = 'static://';
|
||||||
const TESTCONTENT = '<?php $CONFIG=array("foo"=>"bar");';
|
const TESTCONTENT = '<?php $CONFIG=array("foo"=>"bar");';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \OC\Config
|
||||||
|
*/
|
||||||
|
private $config;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
file_put_contents(self::CONFIG_FILE, self::TESTCONTENT);
|
file_put_contents(self::CONFIG_FILE, self::TESTCONTENT);
|
||||||
$this->config = new OC\Config(self::CONFIG_DIR);
|
$this->config = new OC\Config(self::CONFIG_DIR);
|
||||||
|
@ -94,14 +99,12 @@ EOL
|
||||||
, $content);
|
, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @expectedException \OC\HintException
|
||||||
|
*/
|
||||||
public function testWriteData()
|
public function testWriteData()
|
||||||
{
|
{
|
||||||
$config = new OC\Config('/non-writable');
|
$config = new OC\Config('/non-writable');
|
||||||
try {
|
|
||||||
$config->setValue('foo', 'bar');
|
$config->setValue('foo', 'bar');
|
||||||
} catch (\OC\HintException $e) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$this->fail();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue