PHPUnit 3.6 does not support @expectedException with the generic exception class

This commit is contained in:
Bart Visscher 2012-10-12 19:28:24 +02:00
parent a0b15dcb12
commit 8c281a456d

View file

@ -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() {