diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-20 02:47:32 -0600 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-20 02:47:32 -0600 |
commit | 50b0a4b1810b921cab5fbd514219f5d26e406c6e (patch) | |
tree | 2a82614ecf2e02783ea9c01e6ea4a97edd4295c8 /tests/lib | |
parent | 5481a9b84a1e3500b36583cb4c300ea0491bbdcd (diff) | |
download | nextcloud-server-50b0a4b1810b921cab5fbd514219f5d26e406c6e.tar.gz nextcloud-server-50b0a4b1810b921cab5fbd514219f5d26e406c6e.zip |
Improve the test case
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/App/ManagerTest.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/lib/App/ManagerTest.php b/tests/lib/App/ManagerTest.php index 79450737266..8b23168938c 100644 --- a/tests/lib/App/ManagerTest.php +++ b/tests/lib/App/ManagerTest.php @@ -130,11 +130,14 @@ class ManagerTest extends TestCase { $this->assertEquals('no', $this->appConfig->getValue('files_trashbin', 'enabled', 'no')); } - /** - * @expectedException \Exception - */ public function testNotEnableIfNotInstalled() { - $this->manager->enableApp('some_random_name_which_i_hope_is_not_an_app'); + try { + $this->manager->enableApp('some_random_name_which_i_hope_is_not_an_app'); + $this->assertFalse(true, 'If this line is reached the expected exception is not thrown.'); + } catch (\Exception $e) { + // excpetion is expected + $this->assertEquals("some_random_name_which_i_hope_is_not_an_app can't be enabled since it is not installed.", $e->getMessage()); + } $this->assertEquals('no', $this->appConfig->getValue( 'some_random_name_which_i_hope_is_not_an_app', 'enabled', 'no' )); |