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

remotes/origin/stable5
Bart Visscher 13 years ago
parent a0b15dcb12
commit 8c281a456d
  1. 10
      tests/lib/share/share.php

@ -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…
Cancel
Save