Signed-off-by: Joas Schilling <coding@schilljs.com>
}
if ($share === null) {
- throw new ShareNotFound();
+ throw new ShareNotFound($this->l->t('The requested share does not exist anymore'));
}
$this->checkExpireDate($share);
if ($share->getExpirationDate() !== null &&
$share->getExpirationDate() <= new \DateTime()) {
$this->deleteShare($share);
- throw new ShareNotFound();
+ throw new ShareNotFound($this->l->t('The requested share does not exist anymore'));
}
}
/**
* @expectedException \OCP\Share\Exceptions\ShareNotFound
+ * @expectedExceptionMessage The requested share does not exist anymore
*/
public function testGetShareByTokenExpired() {
$this->config
->with('core', 'shareapi_allow_links', 'yes')
->willReturn('yes');
+ $this->l->expects($this->once())
+ ->method('t')
+ ->willReturnArgument(0);
+
$manager = $this->createManagerMock()
->setMethods(['deleteShare'])
->getMock();