public function testUpdateFileTagsStorageGenericException() { $this->tagService->expects($this->once())->method('updateFileTags')->with('/path.txt', ['Tag1', 'Tag2'])->will($this->throwException(new \Exception('My error message'))); $expected = new DataResponse(['message' => 'My error message'], Http::STATUS_NOT_FOUND); $this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt', ['Tag1', 'Tag2'])); }