public function testShowHiddenFiles() { $show = false; $this->config->expects($this->once())->method('setUserValue')->with($this->user->getUID(), 'files', 'show_hidden', $show); $expected = new Http\Response(); $actual = $this->apiController->showHiddenFiles($show); $this->assertEquals($expected, $actual); }
public function testGetThumbnail() { $this->preview->expects($this->once())->method('createPreview')->with('files/known.jpg', 10, 10, true)->willReturn(new Image(\OC::$SERVERROOT . '/tests/data/testimage.jpg')); $ret = $this->apiController->getThumbnail(10, 10, 'known.jpg'); $this->assertEquals(Http::STATUS_OK, $ret->getStatus()); }
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('My error message', Http::STATUS_NOT_FOUND); $this->assertEquals($expected, $this->apiController->updateFileTags('/path.txt', ['Tag1', 'Tag2'])); }