/** * @expectedException \OCP\Files\NotFoundException * @expectedExceptionMessage Sharing is disabled. */ public function testBeforeControllerWithSharingDisabled() { $this->appManager->expects($this->once())->method('isEnabledForUser')->with('files_sharing')->will($this->returnValue(false)); $this->sharingCheckMiddleware->beforeController($this->controllerMock, 'myMethod'); }