From e789e056759aedb93d9eba3a8598acea67c842c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu>
Date: Tue, 2 Jul 2013 00:15:42 +0200
Subject: [PATCH] on unit test use @expectedException some phpdoc added

---
 lib/legacy/config.php |  3 +++
 tests/lib/config.php  | 15 +++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/lib/legacy/config.php b/lib/legacy/config.php
index f68d7c31b2..5294a48ea4 100644
--- a/lib/legacy/config.php
+++ b/lib/legacy/config.php
@@ -41,6 +41,9 @@
 OC_Config::$object = new \OC\Config(OC::$SERVERROOT.'/config/');
 class OC_Config {
 
+	/**
+	 * @var \OC\Config
+	 */
 	public static $object;
 
 	/**
diff --git a/tests/lib/config.php b/tests/lib/config.php
index 8f52cf4ae7..c17d2ae7ef 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');
 	}
 }
-- 
GitLab