. * */ namespace OCA\Passman\Controller; use OCA\Comments\Activity\Setting; use OCA\Passman\Service\ActivityService; use OCA\Passman\Service\CredentialService; use OCA\Passman\Service\FileService; use OCA\Passman\Service\NotificationService; use OCA\Passman\Service\SettingsService; use OCA\Passman\Service\ShareService; use OCA\Passman\Service\VaultService; use OCP\IGroupManager; use OCP\IUserManager; use PHPUnit_Framework_TestCase; use OCP\AppFramework\Http\JSONResponse; /** * Class FileControllerTest * * @package OCA\Passman\Controller * @coversDefaultClass \OCA\Passman\Controller\FileController */ class FileControllerTest extends PHPUnit_Framework_TestCase { private $controller; private $userId = 'example'; private $credentialService; private $vaultService; private $groupManager; private $userManager; private $activityService; private $shareService; private $notificationService; private $fileService; private $settings; public function setUp() { $request = $this->getMockBuilder('OCP\IRequest')->getMock(); $this->fileService = $this->createMock(FileService::class); $this->controller = new FileController( 'passman', $request, $this->userId, $this->fileService ); } /** * @covers ::uploadFile */ public function testUploadFile() { $result = $this->controller->uploadFile('000', '0.png', 'image/png', 3); $this->assertTrue($result instanceof JSONResponse); } /** * @covers ::getFile */ public function testGetFile() { $result = $this->controller->getFile(null); $this->assertTrue($result instanceof JSONResponse); } /** * @covers ::deleteFile */ public function testDeleteFile() { $result = $this->controller->deleteFile(null); $this->assertTrue($result instanceof JSONResponse); } /** * @covers ::updateFile */ public function testUpdateFile() { $this->controller->updateFile('6AD30804-BFFC-4EFC-97F8-20A126FA1709', '0' , '0.jpg'); $this->assertTrue(true); } }