*/
namespace OCA\Theming\Tests\Controller;
+use OC\L10N\L10N;
use OCA\Theming\Controller\ThemingController;
use OCA\Theming\Util;
use OCP\App\IAppManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
+use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\IAppData;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
+use OCP\Files\SimpleFS\ISimpleFile;
+use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IRequest;
private $appData;
public function setUp() {
- $this->request = $this->getMockBuilder('OCP\IRequest')->getMock();
- $this->config = $this->getMockBuilder('OCP\IConfig')->getMock();
- $this->template = $this->getMockBuilder('OCA\Theming\ThemingDefaults')
+ $this->request = $this->getMockBuilder(IRequest::class)->getMock();
+ $this->config = $this->getMockBuilder(IConfig::class)->getMock();
+ $this->template = $this->getMockBuilder(ThemingDefaults::class)
->disableOriginalConstructor()->getMock();
- $this->timeFactory = $this->getMockBuilder('OCP\AppFramework\Utility\ITimeFactory')
+ $this->timeFactory = $this->getMockBuilder(ITimeFactory::class)
->disableOriginalConstructor()
->getMock();
- $this->l10n = $this->getMockBuilder('OCP\IL10N')->getMock();
- $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')->getMock();
- $this->appManager = $this->getMockBuilder('OCP\App\IAppManager')->getMock();
+ $this->l10n = $this->getMockBuilder(L10N::class)->getMock();
+ $this->rootFolder = $this->getMockBuilder(IRootFolder::class)->getMock();
+ $this->appManager = $this->getMockBuilder(IAppManager::class)->getMock();
$this->util = new Util($this->config, $this->rootFolder, $this->appManager);
$this->timeFactory->expects($this->any())
->method('getTime')
->willReturn(123);
$this->tempManager = \OC::$server->getTempManager();
- $this->appData = $this->getMockBuilder('OCP\Files\IAppData')->getMock();
+ $this->appData = $this->getMockBuilder(IAppData::class)->getMock();
$this->themingController = new ThemingController(
'theming',
->willReturn('Saved');
- $file = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile')
+ $file = $this->getMockBuilder(ISimpleFile::class)
->disableOriginalConstructor()
->getMock();
- $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder')
+ $folder = $this->getMockBuilder(ISimpleFolder::class)
->disableOriginalConstructor()
->getMock();
$this->appData
->with('Saved')
->willReturn('Saved');
- $file = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile')
+ $file = $this->getMockBuilder(ISimpleFile::class)
->disableOriginalConstructor()
->getMock();
- $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder')
+ $folder = $this->getMockBuilder(ISimpleFolder::class)
->disableOriginalConstructor()
->getMock();
$this->appData
->with('Unsupported image type')
->willReturn('Unsupported image type');
- $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder')
+ $folder = $this->getMockBuilder(ISimpleFolder::class)
->disableOriginalConstructor()
->getMock();
$this->appData
}
public function testGetLogo() {
- $file = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile')
+ $file = $this->getMockBuilder(ISimpleFile::class)
->disableOriginalConstructor()
->getMock();
- $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder')
+ $folder = $this->getMockBuilder(ISimpleFolder::class)
->disableOriginalConstructor()
->getMock();
$this->appData
}
public function testGetLoginBackground() {
- $file = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile')
+ $file = $this->getMockBuilder(ISimpleFile::class)
->disableOriginalConstructor()
->getMock();
- $folder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder')
+ $folder = $this->getMockBuilder(ISimpleFolder::class)
->disableOriginalConstructor()
->getMock();
$this->appData
namespace OCA\Theming\Tests\Migration;
+use OCP\Files\File;
use OCP\Files\NotFoundException;
+use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\Migration\IOutput;
use Test\TestCase;
public function setUp() {
parent::setUp();
- $this->appData = $this->getMockBuilder('OCP\Files\IAppData')->getMock();
- $this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')->getMock();
+ $this->appData = $this->getMockBuilder(IAppData::class)->getMock();
+ $this->rootFolder = $this->getMockBuilder(IRootFolder::class)->getMock();
$this->repairStep = new ThemingImages($this->appData, $this->rootFolder);
- $this->imageFolder = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFolder')->getMock();
- $this->output = $this->getMockBuilder('OCP\Migration\IOutput')->getMock();
+ $this->imageFolder = $this->getMockBuilder(ISimpleFolder::class)->getMock();
+ $this->output = $this->getMockBuilder(IOutput::class)->getMock();
}
public function testGetName() {
}
public function testRunLogo() {
- $oldFile = $this->getMockBuilder('OCP\Files\File')->getMock();
- $newFile = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile')->getMock();
+ $oldFile = $this->getMockBuilder(File::class)->getMock();
+ $newFile = $this->getMockBuilder(ISimpleFile::class)->getMock();
$this->appData->expects($this->once())
->method('newFolder')
}
public function testRunBackground() {
- $oldFile = $this->getMockBuilder('OCP\Files\File')->getMock();
- $newFile = $this->getMockBuilder('OCP\Files\SimpleFS\ISimpleFile')->getMock();
-
+ $oldFile = $this->getMockBuilder(File::class)->getMock();
+ $newFile = $this->getMockBuilder(ISimpleFile::class)->getMock();
+
$this->appData->expects($this->once())
->method('newFolder')
->willReturn($this->imageFolder);