PHPUnit 3.6 does not support @expectedException with the generic exception class
This commit is contained in:
parent
a0b15dcb12
commit
8c281a456d
1 changed files with 6 additions and 4 deletions
|
@ -61,11 +61,13 @@ class Test_Share extends UnitTestCase {
|
|||
$query->execute(array('test'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
*/
|
||||
public function testShareInvalidShareType() {
|
||||
OCP\Share::shareItem('test', 'test.txt', 'foobar', $this->user2, OCP\Share::PERMISSION_READ);
|
||||
$message = 'Share type foobar is not valid for test.txt';
|
||||
try {
|
||||
OCP\Share::shareItem('test', 'test.txt', 'foobar', $this->user2, OCP\Share::PERMISSION_READ);
|
||||
} catch (Exception $exception) {
|
||||
$this->assertEqual($exception->getMessage(), $message);
|
||||
}
|
||||
}
|
||||
|
||||
public function testInvalidItemType() {
|
||||
|
|
Loading…
Reference in a new issue