Improve the test case

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2017-03-20 02:47:32 -06:00
parent 5481a9b84a
commit 50b0a4b181
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
1 changed files with 7 additions and 4 deletions

View File

@ -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'
));