2016-06-21 19:21:46 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
|
|
|
|
*
|
2016-07-21 14:49:16 +00:00
|
|
|
* @author Julius Haertl <jus@bitgrid.net>
|
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
|
|
|
* @author oparoz <owncloud@interfasys.ch>
|
|
|
|
*
|
2016-06-21 19:21:46 +00:00
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
namespace OCA\Theming\Tests\Controller;
|
|
|
|
|
2017-02-09 16:12:00 +00:00
|
|
|
use OC\L10N\L10N;
|
2016-06-21 19:21:46 +00:00
|
|
|
use OCA\Theming\Controller\ThemingController;
|
2016-07-25 15:32:11 +00:00
|
|
|
use OCA\Theming\Util;
|
2016-11-18 09:49:03 +00:00
|
|
|
use OCP\App\IAppManager;
|
2016-06-21 19:21:46 +00:00
|
|
|
use OCP\AppFramework\Http;
|
|
|
|
use OCP\AppFramework\Http\DataResponse;
|
2017-02-09 16:12:00 +00:00
|
|
|
use OCP\AppFramework\Utility\ITimeFactory;
|
2017-02-09 10:38:45 +00:00
|
|
|
use OCP\Files\IAppData;
|
2016-06-27 08:47:44 +00:00
|
|
|
use OCP\Files\IRootFolder;
|
2016-11-08 18:46:09 +00:00
|
|
|
use OCP\Files\NotFoundException;
|
2017-02-09 16:12:00 +00:00
|
|
|
use OCP\Files\SimpleFS\ISimpleFile;
|
|
|
|
use OCP\Files\SimpleFS\ISimpleFolder;
|
2016-06-21 19:21:46 +00:00
|
|
|
use OCP\IConfig;
|
|
|
|
use OCP\IL10N;
|
|
|
|
use OCP\IRequest;
|
2016-08-27 19:38:41 +00:00
|
|
|
use OCP\ITempManager;
|
2016-06-21 19:21:46 +00:00
|
|
|
use Test\TestCase;
|
2016-08-15 14:24:56 +00:00
|
|
|
use OCA\Theming\ThemingDefaults;
|
2016-06-21 19:21:46 +00:00
|
|
|
|
|
|
|
class ThemingControllerTest extends TestCase {
|
2016-08-01 07:37:12 +00:00
|
|
|
/** @var IRequest|\PHPUnit_Framework_MockObject_MockObject */
|
2016-06-21 19:21:46 +00:00
|
|
|
private $request;
|
2016-08-01 07:37:12 +00:00
|
|
|
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
|
2016-06-21 19:21:46 +00:00
|
|
|
private $config;
|
2016-08-12 14:58:59 +00:00
|
|
|
/** @var ThemingDefaults|\PHPUnit_Framework_MockObject_MockObject */
|
2016-06-21 19:21:46 +00:00
|
|
|
private $template;
|
2016-07-28 14:07:23 +00:00
|
|
|
/** @var Util */
|
|
|
|
private $util;
|
|
|
|
/** @var \OCP\AppFramework\Utility\ITimeFactory */
|
|
|
|
private $timeFactory;
|
2016-08-01 07:37:12 +00:00
|
|
|
/** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
|
2016-06-21 19:21:46 +00:00
|
|
|
private $l10n;
|
|
|
|
/** @var ThemingController */
|
|
|
|
private $themingController;
|
2016-08-01 07:37:12 +00:00
|
|
|
/** @var IRootFolder|\PHPUnit_Framework_MockObject_MockObject */
|
2016-06-27 08:47:44 +00:00
|
|
|
private $rootFolder;
|
2016-08-27 19:38:41 +00:00
|
|
|
/** @var ITempManager */
|
|
|
|
private $tempManager;
|
2017-02-09 10:38:45 +00:00
|
|
|
/** @var IAppManager|\PHPUnit_Framework_MockObject_MockObject */
|
2016-11-18 09:49:03 +00:00
|
|
|
private $appManager;
|
2017-02-09 10:38:45 +00:00
|
|
|
/** @var IAppData|\PHPUnit_Framework_MockObject_MockObject */
|
|
|
|
private $appData;
|
2016-06-21 19:21:46 +00:00
|
|
|
|
|
|
|
public function setUp() {
|
2017-02-09 21:51:05 +00:00
|
|
|
$this->request = $this->createMock(IRequest::class);
|
|
|
|
$this->config = $this->createMock(IConfig::class);
|
|
|
|
$this->template = $this->createMock(ThemingDefaults::class);
|
|
|
|
$this->timeFactory = $this->createMock(ITimeFactory::class);
|
|
|
|
$this->l10n = $this->createMock(L10N::class);
|
|
|
|
$this->rootFolder = $this->createMock(IRootFolder::class);
|
|
|
|
$this->appManager = $this->createMock(IAppManager::class);
|
2016-11-18 09:49:03 +00:00
|
|
|
$this->util = new Util($this->config, $this->rootFolder, $this->appManager);
|
2016-07-28 14:07:23 +00:00
|
|
|
$this->timeFactory->expects($this->any())
|
|
|
|
->method('getTime')
|
|
|
|
->willReturn(123);
|
2016-08-27 19:38:41 +00:00
|
|
|
$this->tempManager = \OC::$server->getTempManager();
|
2017-02-09 21:51:05 +00:00
|
|
|
$this->appData = $this->createMock(IAppData::class);
|
2016-07-28 14:07:23 +00:00
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->themingController = new ThemingController(
|
|
|
|
'theming',
|
|
|
|
$this->request,
|
|
|
|
$this->config,
|
|
|
|
$this->template,
|
2016-07-28 14:07:23 +00:00
|
|
|
$this->util,
|
|
|
|
$this->timeFactory,
|
2016-06-27 08:47:44 +00:00
|
|
|
$this->l10n,
|
2017-02-09 10:38:45 +00:00
|
|
|
$this->tempManager,
|
|
|
|
$this->appData
|
2016-06-21 19:21:46 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
return parent::setUp();
|
|
|
|
}
|
|
|
|
|
2016-08-01 07:37:12 +00:00
|
|
|
public function dataUpdateStylesheet() {
|
|
|
|
return [
|
|
|
|
['name', str_repeat('a', 250), 'success', 'Saved'],
|
|
|
|
['name', str_repeat('a', 251), 'error', 'The given name is too long'],
|
|
|
|
['url', str_repeat('a', 500), 'success', 'Saved'],
|
|
|
|
['url', str_repeat('a', 501), 'error', 'The given web address is too long'],
|
|
|
|
['slogan', str_repeat('a', 500), 'success', 'Saved'],
|
|
|
|
['slogan', str_repeat('a', 501), 'error', 'The given slogan is too long'],
|
|
|
|
['color', '#0082c9', 'success', 'Saved'],
|
|
|
|
['color', '#0082C9', 'success', 'Saved'],
|
|
|
|
['color', '0082C9', 'error', 'The given color is invalid'],
|
|
|
|
['color', '#0082Z9', 'error', 'The given color is invalid'],
|
|
|
|
['color', 'Nextcloud', 'error', 'The given color is invalid'],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider dataUpdateStylesheet
|
|
|
|
*
|
|
|
|
* @param string $setting
|
|
|
|
* @param string $value
|
|
|
|
* @param string $status
|
|
|
|
* @param string $message
|
|
|
|
*/
|
|
|
|
public function testUpdateStylesheet($setting, $value, $status, $message) {
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->template
|
2016-08-01 07:37:12 +00:00
|
|
|
->expects($status === 'success' ? $this->once() : $this->never())
|
2016-06-21 19:21:46 +00:00
|
|
|
->method('set')
|
2016-08-01 07:37:12 +00:00
|
|
|
->with($setting, $value);
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->l10n
|
|
|
|
->expects($this->once())
|
|
|
|
->method('t')
|
2016-08-01 07:37:12 +00:00
|
|
|
->with($message)
|
|
|
|
->willReturn($message);
|
2016-06-21 19:21:46 +00:00
|
|
|
|
2016-08-01 07:37:12 +00:00
|
|
|
$expected = new DataResponse([
|
|
|
|
'data' => [
|
|
|
|
'message' => $message,
|
|
|
|
],
|
|
|
|
'status' => $status,
|
|
|
|
]);
|
|
|
|
$this->assertEquals($expected, $this->themingController->updateStylesheet($setting, $value));
|
2016-06-21 19:21:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testUpdateLogoNoData() {
|
|
|
|
$this->request
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getUploadedFile')
|
|
|
|
->with('uploadlogo')
|
|
|
|
->willReturn(null);
|
|
|
|
$this->request
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getUploadedFile')
|
|
|
|
->with('upload-login-background')
|
|
|
|
->willReturn(null);
|
|
|
|
$this->l10n
|
|
|
|
->expects($this->once())
|
|
|
|
->method('t')
|
|
|
|
->with('No file uploaded')
|
|
|
|
->willReturn('No file uploaded');
|
|
|
|
|
|
|
|
$expected = new DataResponse(
|
|
|
|
[
|
|
|
|
'data' =>
|
|
|
|
[
|
|
|
|
'message' => 'No file uploaded',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
Http::STATUS_UNPROCESSABLE_ENTITY
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->assertEquals($expected, $this->themingController->updateLogo());
|
|
|
|
}
|
|
|
|
|
2017-02-16 14:13:19 +00:00
|
|
|
public function dataUpdateImages() {
|
|
|
|
return [
|
|
|
|
[false],
|
|
|
|
[true]
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/** @dataProvider dataUpdateImages */
|
|
|
|
public function testUpdateLogoNormalLogoUpload($folderExists) {
|
2016-06-21 19:21:46 +00:00
|
|
|
$tmpLogo = \OC::$server->getTempManager()->getTemporaryFolder() . '/logo.svg';
|
|
|
|
$destination = \OC::$server->getTempManager()->getTemporaryFolder();
|
|
|
|
|
|
|
|
touch($tmpLogo);
|
|
|
|
$this->request
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getUploadedFile')
|
|
|
|
->with('uploadlogo')
|
|
|
|
->willReturn([
|
|
|
|
'tmp_name' => $tmpLogo,
|
|
|
|
'type' => 'text/svg',
|
|
|
|
'name' => 'logo.svg',
|
|
|
|
]);
|
|
|
|
$this->request
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getUploadedFile')
|
|
|
|
->with('upload-login-background')
|
|
|
|
->willReturn(null);
|
|
|
|
$this->l10n
|
|
|
|
->expects($this->once())
|
|
|
|
->method('t')
|
|
|
|
->with('Saved')
|
|
|
|
->willReturn('Saved');
|
2017-02-09 10:38:45 +00:00
|
|
|
|
|
|
|
|
2017-02-09 21:51:05 +00:00
|
|
|
$file = $this->createMock(ISimpleFile::class);
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class);
|
2017-02-16 14:13:19 +00:00
|
|
|
if($folderExists) {
|
|
|
|
$this->appData
|
|
|
|
->expects($this->once())
|
|
|
|
->method('getFolder')
|
|
|
|
->with('images')
|
|
|
|
->willReturn($folder);
|
|
|
|
} else {
|
|
|
|
$this->appData
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getFolder')
|
|
|
|
->with('images')
|
|
|
|
->willThrowException(new NotFoundException());
|
|
|
|
$this->appData
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('newFolder')
|
|
|
|
->with('images')
|
|
|
|
->willReturn($folder);
|
|
|
|
}
|
2017-02-09 10:38:45 +00:00
|
|
|
$folder->expects($this->once())
|
2016-06-27 08:47:44 +00:00
|
|
|
->method('newFile')
|
2017-02-09 10:38:45 +00:00
|
|
|
->with('logo')
|
2016-06-27 08:47:44 +00:00
|
|
|
->willReturn($file);
|
2016-06-21 19:21:46 +00:00
|
|
|
$expected = new DataResponse(
|
|
|
|
[
|
|
|
|
'data' =>
|
|
|
|
[
|
|
|
|
'name' => 'logo.svg',
|
|
|
|
'message' => 'Saved',
|
|
|
|
],
|
|
|
|
'status' => 'success'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->assertEquals($expected, $this->themingController->updateLogo());
|
|
|
|
}
|
|
|
|
|
2017-02-16 14:13:19 +00:00
|
|
|
/** @dataProvider dataUpdateImages */
|
|
|
|
public function testUpdateLogoLoginScreenUpload($folderExists) {
|
2016-06-21 19:21:46 +00:00
|
|
|
$tmpLogo = \OC::$server->getTempManager()->getTemporaryFolder() . '/logo.svg';
|
|
|
|
|
|
|
|
touch($tmpLogo);
|
2016-08-27 10:38:15 +00:00
|
|
|
file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/desktopapp.png'));
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->request
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getUploadedFile')
|
|
|
|
->with('uploadlogo')
|
|
|
|
->willReturn(null);
|
|
|
|
$this->request
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getUploadedFile')
|
|
|
|
->with('upload-login-background')
|
|
|
|
->willReturn([
|
|
|
|
'tmp_name' => $tmpLogo,
|
|
|
|
'type' => 'text/svg',
|
|
|
|
'name' => 'logo.svg',
|
|
|
|
]);
|
|
|
|
$this->l10n
|
|
|
|
->expects($this->once())
|
|
|
|
->method('t')
|
|
|
|
->with('Saved')
|
|
|
|
->willReturn('Saved');
|
2017-02-09 10:38:45 +00:00
|
|
|
|
2017-02-09 21:51:05 +00:00
|
|
|
$file = $this->createMock(ISimpleFile::class);
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class);
|
2017-02-16 14:13:19 +00:00
|
|
|
if($folderExists) {
|
|
|
|
$this->appData
|
|
|
|
->expects($this->once())
|
|
|
|
->method('getFolder')
|
|
|
|
->with('images')
|
|
|
|
->willReturn($folder);
|
|
|
|
} else {
|
|
|
|
$this->appData
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getFolder')
|
|
|
|
->with('images')
|
|
|
|
->willThrowException(new NotFoundException());
|
|
|
|
$this->appData
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('newFolder')
|
|
|
|
->with('images')
|
|
|
|
->willReturn($folder);
|
|
|
|
}
|
2017-02-09 10:38:45 +00:00
|
|
|
$folder->expects($this->once())
|
2016-06-27 08:47:44 +00:00
|
|
|
->method('newFile')
|
2017-02-09 10:38:45 +00:00
|
|
|
->with('background')
|
2016-06-27 08:47:44 +00:00
|
|
|
->willReturn($file);
|
2016-06-21 19:21:46 +00:00
|
|
|
|
|
|
|
$expected = new DataResponse(
|
|
|
|
[
|
|
|
|
'data' =>
|
|
|
|
[
|
|
|
|
'name' => 'logo.svg',
|
|
|
|
'message' => 'Saved',
|
|
|
|
],
|
|
|
|
'status' => 'success'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
$this->assertEquals($expected, $this->themingController->updateLogo());
|
|
|
|
}
|
|
|
|
|
2016-08-27 10:38:15 +00:00
|
|
|
public function testUpdateLogoLoginScreenUploadWithInvalidImage() {
|
|
|
|
$tmpLogo = \OC::$server->getTempManager()->getTemporaryFolder() . '/logo.svg';
|
|
|
|
|
|
|
|
touch($tmpLogo);
|
|
|
|
file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/data.zip'));
|
|
|
|
$this->request
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getUploadedFile')
|
|
|
|
->with('uploadlogo')
|
|
|
|
->willReturn(null);
|
|
|
|
$this->request
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getUploadedFile')
|
|
|
|
->with('upload-login-background')
|
|
|
|
->willReturn([
|
|
|
|
'tmp_name' => $tmpLogo,
|
|
|
|
'type' => 'text/svg',
|
|
|
|
'name' => 'logo.svg',
|
|
|
|
]);
|
|
|
|
$this->l10n
|
|
|
|
->expects($this->once())
|
|
|
|
->method('t')
|
|
|
|
->with('Unsupported image type')
|
|
|
|
->willReturn('Unsupported image type');
|
2017-02-09 10:38:45 +00:00
|
|
|
|
2017-02-09 21:51:05 +00:00
|
|
|
$folder = $this->createMock(ISimpleFolder::class);
|
2017-02-09 10:38:45 +00:00
|
|
|
$this->appData
|
2016-08-27 10:38:15 +00:00
|
|
|
->expects($this->once())
|
2017-02-09 10:38:45 +00:00
|
|
|
->method('getFolder')
|
|
|
|
->with('images')
|
|
|
|
->willReturn($folder);
|
|
|
|
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected = new DataResponse(
|
|
|
|
[
|
|
|
|
'data' =>
|
|
|
|
[
|
|
|
|
'message' => 'Unsupported image type',
|
|
|
|
],
|
|
|
|
'status' => 'failure'
|
|
|
|
],
|
|
|
|
Http::STATUS_UNPROCESSABLE_ENTITY
|
|
|
|
);
|
|
|
|
$this->assertEquals($expected, $this->themingController->updateLogo());
|
|
|
|
}
|
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
public function testUndo() {
|
|
|
|
$this->l10n
|
|
|
|
->expects($this->once())
|
|
|
|
->method('t')
|
|
|
|
->with('Saved')
|
|
|
|
->willReturn('Saved');
|
|
|
|
$this->template
|
|
|
|
->expects($this->once())
|
|
|
|
->method('undo')
|
|
|
|
->with('MySetting')
|
|
|
|
->willReturn('MyValue');
|
|
|
|
|
|
|
|
$expected = new DataResponse(
|
|
|
|
[
|
|
|
|
'data' =>
|
|
|
|
[
|
|
|
|
'value' => 'MyValue',
|
|
|
|
'message' => 'Saved',
|
|
|
|
],
|
|
|
|
'status' => 'success'
|
|
|
|
]
|
|
|
|
);
|
|
|
|
$this->assertEquals($expected, $this->themingController->undo('MySetting'));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetLogoNotExistent() {
|
2017-02-09 10:38:45 +00:00
|
|
|
$this->appData->method('getFolder')
|
|
|
|
->with($this->equalTo('images'))
|
2016-11-08 18:46:09 +00:00
|
|
|
->willThrowException(new NotFoundException());
|
|
|
|
|
|
|
|
$expected = new Http\NotFoundResponse();
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->assertEquals($expected, $this->themingController->getLogo());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetLogo() {
|
2017-02-09 21:51:05 +00:00
|
|
|
$file = $this->createMock(ISimpleFile::class);
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class);
|
2017-02-09 10:38:45 +00:00
|
|
|
$this->appData
|
|
|
|
->expects($this->once())
|
|
|
|
->method('getFolder')
|
|
|
|
->with('images')
|
|
|
|
->willReturn($folder);
|
|
|
|
$folder->expects($this->once())
|
|
|
|
->method('getFile')
|
|
|
|
->with('logo')
|
2016-11-08 18:46:09 +00:00
|
|
|
->willReturn($file);
|
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->config
|
|
|
|
->expects($this->once())
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'logoMime', '')
|
|
|
|
->willReturn('text/svg');
|
|
|
|
|
2017-02-09 10:38:45 +00:00
|
|
|
@$expected = new Http\FileDisplayResponse($file);
|
2016-06-21 19:21:46 +00:00
|
|
|
$expected->cacheFor(3600);
|
2017-02-09 10:38:45 +00:00
|
|
|
$expires = new \DateTime();
|
|
|
|
$expires->setTimestamp($this->timeFactory->getTime());
|
|
|
|
$expires->add(new \DateInterval('PT24H'));
|
|
|
|
$expected->addHeader('Expires', $expires->format(\DateTime::RFC2822));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2017-02-09 10:38:45 +00:00
|
|
|
$expected->addHeader('Content-Type', 'text/svg');
|
2016-06-21 19:21:46 +00:00
|
|
|
@$this->assertEquals($expected, $this->themingController->getLogo());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testGetLoginBackgroundNotExistent() {
|
2017-02-09 10:38:45 +00:00
|
|
|
$this->appData->method('getFolder')
|
|
|
|
->with($this->equalTo('images'))
|
2016-11-08 18:46:09 +00:00
|
|
|
->willThrowException(new NotFoundException());
|
|
|
|
$expected = new Http\NotFoundResponse();
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->assertEquals($expected, $this->themingController->getLoginBackground());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetLoginBackground() {
|
2017-02-09 21:51:05 +00:00
|
|
|
$file = $this->createMock(ISimpleFile::class);
|
|
|
|
$folder = $this->createMock(ISimpleFolder::class);
|
2017-02-09 10:38:45 +00:00
|
|
|
$this->appData
|
|
|
|
->expects($this->once())
|
|
|
|
->method('getFolder')
|
|
|
|
->with('images')
|
|
|
|
->willReturn($folder);
|
|
|
|
$folder->expects($this->once())
|
|
|
|
->method('getFile')
|
|
|
|
->with('background')
|
2016-11-08 18:46:09 +00:00
|
|
|
->willReturn($file);
|
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->config
|
|
|
|
->expects($this->once())
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'backgroundMime', '')
|
|
|
|
->willReturn('image/png');
|
|
|
|
|
2017-02-09 10:38:45 +00:00
|
|
|
@$expected = new Http\FileDisplayResponse($file);
|
2016-06-21 19:21:46 +00:00
|
|
|
$expected->cacheFor(3600);
|
2017-02-09 10:38:45 +00:00
|
|
|
$expires = new \DateTime();
|
|
|
|
$expires->setTimestamp($this->timeFactory->getTime());
|
|
|
|
$expires->add(new \DateInterval('PT24H'));
|
|
|
|
$expected->addHeader('Expires', $expires->format(\DateTime::RFC2822));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2017-02-09 10:38:45 +00:00
|
|
|
$expected->addHeader('Content-Type', 'image/png');
|
2016-06-21 19:21:46 +00:00
|
|
|
@$this->assertEquals($expected, $this->themingController->getLoginBackground());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetStylesheetWithOnlyColor() {
|
2016-07-28 09:45:42 +00:00
|
|
|
|
|
|
|
$color = '#000';
|
|
|
|
|
2016-07-15 12:04:19 +00:00
|
|
|
$this->config
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'cachebuster', '0')
|
|
|
|
->willReturn('0');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'color', '')
|
2016-07-28 09:45:42 +00:00
|
|
|
->willReturn($color);
|
2016-07-15 12:04:19 +00:00
|
|
|
$this->config
|
|
|
|
->expects($this->at(2))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'logoMime', '')
|
|
|
|
->willReturn('');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(3))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'backgroundMime', '')
|
|
|
|
->willReturn('');
|
|
|
|
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData = sprintf(
|
|
|
|
'#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: %s}' . "\n",
|
|
|
|
$color
|
|
|
|
);
|
|
|
|
$expectedData .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' .
|
2016-07-25 14:44:56 +00:00
|
|
|
'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' .
|
|
|
|
'background-color: %s; background-position: center center; background-size:contain;' .
|
2016-11-16 12:44:45 +00:00
|
|
|
'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' .
|
2016-07-25 14:44:56 +00:00
|
|
|
"}\n",
|
|
|
|
\OC::$WEBROOT,
|
2016-07-28 09:45:42 +00:00
|
|
|
$color
|
2016-07-25 14:44:56 +00:00
|
|
|
);
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' .
|
2016-07-28 14:07:23 +00:00
|
|
|
'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton($color).'\');' .
|
2016-07-25 15:32:11 +00:00
|
|
|
"}\n";
|
2016-08-08 13:06:17 +00:00
|
|
|
$expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' .
|
2016-08-29 17:07:27 +00:00
|
|
|
'.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active {' .
|
|
|
|
'border: 1px solid '.$color.';'.
|
2016-08-08 13:06:17 +00:00
|
|
|
'background-color: '.$color.';'.
|
2016-08-29 17:07:27 +00:00
|
|
|
'color: #ffffff;'.
|
2016-08-08 13:06:17 +00:00
|
|
|
"}\n" .
|
|
|
|
'.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' .
|
|
|
|
'.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' .
|
|
|
|
'border: 1px solid '.$color.';'.
|
|
|
|
'background-color: '.$color.';'.
|
2016-08-29 17:07:27 +00:00
|
|
|
'color: #ffffff;'.
|
|
|
|
"}\n" .
|
|
|
|
'.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' .
|
|
|
|
'.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' .
|
|
|
|
'.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' .
|
|
|
|
'border: 1px solid '.$color.';'.
|
|
|
|
'background-color: '.$color.';'.
|
|
|
|
'opacity: 0.4;' .
|
|
|
|
'color: #ffffff;'.
|
2016-08-08 13:06:17 +00:00
|
|
|
"}\n";
|
2016-08-10 20:06:36 +00:00
|
|
|
$expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n";
|
|
|
|
$expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' .
|
|
|
|
'border: 1px solid ' . $color . ';' .
|
|
|
|
'color: ' . $color . ';' .
|
|
|
|
"}\n";
|
|
|
|
$expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' .
|
|
|
|
'color: ' . $color . ';' .
|
|
|
|
"}\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= '
|
|
|
|
#firstrunwizard .firstrunwizard-header {
|
2016-08-01 06:39:40 +00:00
|
|
|
background-color: ' . $color . ';
|
2016-07-28 09:45:42 +00:00
|
|
|
}
|
|
|
|
#firstrunwizard p a {
|
2016-08-01 06:39:40 +00:00
|
|
|
color: ' . $color . ';
|
2016-07-28 09:45:42 +00:00
|
|
|
}
|
|
|
|
';
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= sprintf('.nc-theming-main-background {background-color: %s}' . "\n", $color);
|
|
|
|
$expectedData .= sprintf('.nc-theming-main-text {color: %s}' . "\n", $color);
|
2017-01-19 03:42:50 +00:00
|
|
|
$expectedData .= sprintf('#app-navigation li:hover > a, #app-navigation li:focus > a, #app-navigation a:focus, #app-navigation .selected, #app-navigation .selected a, #app-navigation .active, #app-navigation .active a {box-shadow: inset 2px 0 %s}' . "\n", $color);
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= '.nc-theming-contrast {color: #ffffff}' . "\n";
|
2016-08-14 10:54:06 +00:00
|
|
|
$expectedData .= '.icon-file,.icon-filetype-text {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
|
2016-10-17 12:51:31 +00:00
|
|
|
'.icon-folder, .icon-filetype-folder {' .
|
2016-08-14 10:54:06 +00:00
|
|
|
'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
|
|
|
|
'.icon-filetype-folder-drag-accept {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
|
|
|
|
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
|
|
|
|
|
2016-07-15 12:04:19 +00:00
|
|
|
$expected->cacheFor(3600);
|
2016-07-28 14:07:23 +00:00
|
|
|
$expected->addHeader('Expires', date(\DateTime::RFC2822, 123));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2016-07-15 12:04:19 +00:00
|
|
|
@$this->assertEquals($expected, $this->themingController->getStylesheet());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetStylesheetWithOnlyColorInvert() {
|
2016-07-28 09:45:42 +00:00
|
|
|
|
|
|
|
$color = '#fff';
|
2016-08-10 20:06:36 +00:00
|
|
|
$elementColor = '#555555';
|
2016-07-28 09:45:42 +00:00
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->config
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'cachebuster', '0')
|
|
|
|
->willReturn('0');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'color', '')
|
2016-07-28 09:45:42 +00:00
|
|
|
->willReturn($color);
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->config
|
|
|
|
->expects($this->at(2))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'logoMime', '')
|
|
|
|
->willReturn('');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(3))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'backgroundMime', '')
|
|
|
|
->willReturn('');
|
2016-07-28 09:45:42 +00:00
|
|
|
|
|
|
|
$expectedData = sprintf(
|
|
|
|
'#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: %s}' . "\n",
|
|
|
|
$color
|
|
|
|
);
|
|
|
|
$expectedData .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' .
|
2016-07-25 14:44:56 +00:00
|
|
|
'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' .
|
2016-07-28 09:45:42 +00:00
|
|
|
'background-color: #555555; background-position: center center; background-size:contain;' .
|
2016-11-16 12:44:45 +00:00
|
|
|
'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' .
|
2016-07-25 14:44:56 +00:00
|
|
|
"}\n",
|
2016-07-28 09:45:42 +00:00
|
|
|
\OC::$WEBROOT
|
2016-07-25 14:44:56 +00:00
|
|
|
);
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' .
|
2016-07-28 14:07:23 +00:00
|
|
|
'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton('#555555').'\');' .
|
2016-07-25 15:32:11 +00:00
|
|
|
"}\n";
|
2016-08-08 13:06:17 +00:00
|
|
|
$expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' .
|
2016-08-29 17:07:27 +00:00
|
|
|
'.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active {' .
|
|
|
|
'border: 1px solid '.$elementColor.';'.
|
|
|
|
'background-color: '.$elementColor.';'.
|
|
|
|
'color: #000000;'.
|
2016-08-08 13:06:17 +00:00
|
|
|
"}\n" .
|
|
|
|
'.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' .
|
|
|
|
'.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' .
|
2016-08-29 17:07:27 +00:00
|
|
|
'border: 1px solid '.$elementColor.';'.
|
|
|
|
'background-color: '.$elementColor.';'.
|
|
|
|
'color: #000000;'.
|
|
|
|
"}\n" .
|
|
|
|
'.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' .
|
|
|
|
'.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' .
|
|
|
|
'.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' .
|
|
|
|
'border: 1px solid '.$elementColor.';'.
|
|
|
|
'background-color: '.$elementColor.';'.
|
|
|
|
'opacity: 0.4;' .
|
|
|
|
'color: #000000;'.
|
2016-08-08 13:06:17 +00:00
|
|
|
"}\n";
|
2016-08-10 20:06:36 +00:00
|
|
|
$expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n";
|
|
|
|
$expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' .
|
|
|
|
'border: 1px solid ' . $color . ';' .
|
|
|
|
'color: ' . $elementColor . ';' .
|
|
|
|
"}\n";
|
|
|
|
$expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' .
|
|
|
|
'color: ' . $elementColor . ';' .
|
|
|
|
"}\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= '
|
|
|
|
#firstrunwizard .firstrunwizard-header {
|
2016-08-01 06:39:40 +00:00
|
|
|
background-color: ' . $color . ';
|
2016-07-28 09:45:42 +00:00
|
|
|
}
|
|
|
|
#firstrunwizard p a {
|
2016-08-01 06:39:40 +00:00
|
|
|
color: ' . $color . ';
|
2016-07-28 09:45:42 +00:00
|
|
|
}
|
|
|
|
';
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= sprintf('.nc-theming-main-background {background-color: %s}' . "\n", $color);
|
|
|
|
$expectedData .= sprintf('.nc-theming-main-text {color: %s}' . "\n", $color);
|
2017-01-19 03:42:50 +00:00
|
|
|
$expectedData .= sprintf('#app-navigation li:hover > a, #app-navigation li:focus > a, #app-navigation a:focus, #app-navigation .selected, #app-navigation .selected a, #app-navigation .active, #app-navigation .active a {box-shadow: inset 2px 0 %s}' . "\n", $color);
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= '#header .header-appname, #expandDisplayName { color: #000000; }' . "\n";
|
|
|
|
$expectedData .= '#header .icon-caret { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/caret-dark.svg\'); }' . "\n";
|
|
|
|
$expectedData .= '.searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }' . "\n";
|
|
|
|
$expectedData .= '.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid { color: #000; border: 1px solid rgba(0, 0, 0, .5); }' . "\n";
|
2016-10-25 12:24:24 +00:00
|
|
|
$expectedData .= '#body-login input.login { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/confirm.svg?v=2\'); }' . "\n";
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= '.nc-theming-contrast {color: #000000}' . "\n";
|
2016-08-10 20:06:36 +00:00
|
|
|
$expectedData .= '.ui-widget-header { color: #000000; }' . "\n";
|
2016-08-14 10:54:06 +00:00
|
|
|
$expectedData .= '.icon-file,.icon-filetype-text {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
|
2016-10-17 12:51:31 +00:00
|
|
|
'.icon-folder, .icon-filetype-folder {' .
|
2016-08-14 10:54:06 +00:00
|
|
|
'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
|
|
|
|
'.icon-filetype-folder-drag-accept {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
|
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
$expected->cacheFor(3600);
|
2016-07-28 14:07:23 +00:00
|
|
|
$expected->addHeader('Expires', date(\DateTime::RFC2822, 123));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2016-06-21 19:21:46 +00:00
|
|
|
@$this->assertEquals($expected, $this->themingController->getStylesheet());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetStylesheetWithOnlyHeaderLogo() {
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'cachebuster', '0')
|
|
|
|
->willReturn('0');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'color', '')
|
|
|
|
->willReturn('');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(2))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'logoMime', '')
|
|
|
|
->willReturn('image/png');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(3))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'backgroundMime', '')
|
|
|
|
->willReturn('');
|
|
|
|
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData = '#header .logo {' .
|
2016-08-01 06:39:40 +00:00
|
|
|
'background-image: url(\'./logo?v=0\');' .
|
2016-07-19 12:39:53 +00:00
|
|
|
'background-size: contain;' .
|
2016-07-25 14:44:56 +00:00
|
|
|
'}' . "\n" .
|
2016-07-19 12:39:53 +00:00
|
|
|
'#header .logo-icon {' .
|
|
|
|
'background-image: url(\'./logo?v=0\');' .
|
|
|
|
'background-size: contain;' .
|
2016-07-28 09:45:42 +00:00
|
|
|
'}' . "\n" .
|
|
|
|
'#firstrunwizard .firstrunwizard-header .logo {' .
|
|
|
|
'background-image: url(\'./logo?v=0\');' .
|
|
|
|
'background-size: contain;' .
|
2016-07-25 14:44:56 +00:00
|
|
|
'}' . "\n";
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= '.nc-theming-contrast {color: #ffffff}' . "\n";
|
2016-08-14 10:54:06 +00:00
|
|
|
$expectedData .= '.icon-file,.icon-filetype-text {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
|
2016-10-17 12:51:31 +00:00
|
|
|
'.icon-folder, .icon-filetype-folder {' .
|
2016-08-14 10:54:06 +00:00
|
|
|
'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
|
|
|
|
'.icon-filetype-folder-drag-accept {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
|
|
|
|
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
|
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
$expected->cacheFor(3600);
|
2016-07-28 14:07:23 +00:00
|
|
|
$expected->addHeader('Expires', date(\DateTime::RFC2822, 123));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2016-06-21 19:21:46 +00:00
|
|
|
@$this->assertEquals($expected, $this->themingController->getStylesheet());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetStylesheetWithOnlyBackgroundLogin() {
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'cachebuster', '0')
|
|
|
|
->willReturn('0');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'color', '')
|
|
|
|
->willReturn('');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(2))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'logoMime', '')
|
|
|
|
->willReturn('');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(3))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'backgroundMime', '')
|
|
|
|
->willReturn('text/svg');
|
|
|
|
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData = '#body-login {background-image: url(\'./loginbackground?v=0\');}' . "\n";
|
2016-07-28 14:32:39 +00:00
|
|
|
$expectedData .= '#firstrunwizard .firstrunwizard-header {' .
|
2016-07-28 09:45:42 +00:00
|
|
|
'background-image: url(\'./loginbackground?v=0\');' .
|
|
|
|
'}' . "\n";
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= '.nc-theming-contrast {color: #ffffff}' . "\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
|
|
|
|
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
|
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
$expected->cacheFor(3600);
|
2016-07-28 14:07:23 +00:00
|
|
|
$expected->addHeader('Expires', date(\DateTime::RFC2822, 123));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2016-06-21 19:21:46 +00:00
|
|
|
@$this->assertEquals($expected, $this->themingController->getStylesheet());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetStylesheetWithAllCombined() {
|
2016-07-28 09:45:42 +00:00
|
|
|
|
|
|
|
$color = '#000';
|
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->config
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'cachebuster', '0')
|
|
|
|
->willReturn('0');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'color', '')
|
2016-07-28 09:45:42 +00:00
|
|
|
->willReturn($color);
|
2016-06-21 19:21:46 +00:00
|
|
|
$this->config
|
|
|
|
->expects($this->at(2))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'logoMime', '')
|
|
|
|
->willReturn('text/svg');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(3))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'backgroundMime', '')
|
|
|
|
->willReturn('image/png');
|
|
|
|
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData = sprintf(
|
|
|
|
'#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: %s}' . "\n",
|
|
|
|
$color);
|
|
|
|
|
|
|
|
$expectedData .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' .
|
2016-07-25 14:44:56 +00:00
|
|
|
'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' .
|
|
|
|
'background-color: %s; background-position: center center; background-size:contain;' .
|
2016-11-16 12:44:45 +00:00
|
|
|
'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' .
|
2016-07-25 14:44:56 +00:00
|
|
|
"}\n",
|
|
|
|
\OC::$WEBROOT,
|
2016-07-28 09:45:42 +00:00
|
|
|
$color
|
2016-07-25 14:44:56 +00:00
|
|
|
);
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' .
|
2016-07-28 14:07:23 +00:00
|
|
|
'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton($color).'\');' .
|
2016-07-25 15:32:11 +00:00
|
|
|
"}\n";
|
2016-08-08 13:06:17 +00:00
|
|
|
$expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' .
|
2016-08-29 17:07:27 +00:00
|
|
|
'.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active {' .
|
|
|
|
'border: 1px solid '.$color.';'.
|
2016-08-08 13:06:17 +00:00
|
|
|
'background-color: '.$color.';'.
|
2016-08-29 17:07:27 +00:00
|
|
|
'color: #ffffff;'.
|
2016-08-08 13:06:17 +00:00
|
|
|
"}\n" .
|
|
|
|
'.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' .
|
|
|
|
'.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' .
|
|
|
|
'border: 1px solid '.$color.';'.
|
|
|
|
'background-color: '.$color.';'.
|
2016-08-29 17:07:27 +00:00
|
|
|
'color: #ffffff;'.
|
|
|
|
"}\n" .
|
|
|
|
'.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' .
|
|
|
|
'.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' .
|
|
|
|
'.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' .
|
|
|
|
'border: 1px solid '.$color.';'.
|
|
|
|
'background-color: '.$color.';'.
|
|
|
|
'opacity: 0.4;' .
|
|
|
|
'color: #ffffff;'.
|
2016-08-08 13:06:17 +00:00
|
|
|
"}\n";
|
2016-08-10 20:06:36 +00:00
|
|
|
$expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n";
|
|
|
|
$expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' .
|
|
|
|
'border: 1px solid ' . $color . ';' .
|
|
|
|
'color: ' . $color . ';' .
|
|
|
|
"}\n";
|
|
|
|
$expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' .
|
|
|
|
'color: ' . $color . ';' .
|
|
|
|
"}\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= '
|
|
|
|
#firstrunwizard .firstrunwizard-header {
|
2016-08-01 06:39:40 +00:00
|
|
|
background-color: ' . $color . ';
|
2016-07-28 09:45:42 +00:00
|
|
|
}
|
|
|
|
#firstrunwizard p a {
|
2016-08-01 06:39:40 +00:00
|
|
|
color: ' . $color . ';
|
2016-07-28 09:45:42 +00:00
|
|
|
}
|
|
|
|
';
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= sprintf('.nc-theming-main-background {background-color: %s}' . "\n", $color);
|
|
|
|
$expectedData .= sprintf('.nc-theming-main-text {color: %s}' . "\n", $color);
|
2017-01-19 03:42:50 +00:00
|
|
|
$expectedData .= sprintf('#app-navigation li:hover > a, #app-navigation li:focus > a, #app-navigation a:focus, #app-navigation .selected, #app-navigation .selected a, #app-navigation .active, #app-navigation .active a {box-shadow: inset 2px 0 %s}' . "\n", $color);
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= sprintf(
|
|
|
|
'#header .logo {' .
|
2016-08-01 06:39:40 +00:00
|
|
|
'background-image: url(\'./logo?v=0\');' .
|
2016-07-19 12:39:53 +00:00
|
|
|
'background-size: contain;' .
|
2016-07-25 14:44:56 +00:00
|
|
|
'}' . "\n" .
|
2016-07-19 12:39:53 +00:00
|
|
|
'#header .logo-icon {' .
|
|
|
|
'background-image: url(\'./logo?v=0\');' .
|
|
|
|
'background-size: contain;' .
|
2016-07-28 09:45:42 +00:00
|
|
|
'}' . "\n" .
|
|
|
|
'#firstrunwizard .firstrunwizard-header .logo {' .
|
|
|
|
'background-image: url(\'./logo?v=0\');' .
|
|
|
|
'background-size: contain;' .
|
|
|
|
'}' . "\n"
|
|
|
|
);
|
|
|
|
$expectedData .= '#body-login {background-image: url(\'./loginbackground?v=0\');}' . "\n";
|
2016-07-28 14:32:39 +00:00
|
|
|
$expectedData .= '#firstrunwizard .firstrunwizard-header {' .
|
2016-07-28 09:45:42 +00:00
|
|
|
'background-image: url(\'./loginbackground?v=0\');' .
|
2016-07-25 14:44:56 +00:00
|
|
|
'}' . "\n";
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= '.nc-theming-contrast {color: #ffffff}' . "\n";
|
2016-08-14 10:54:06 +00:00
|
|
|
$expectedData .= '.icon-file,.icon-filetype-text {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
|
2016-10-17 12:51:31 +00:00
|
|
|
'.icon-folder, .icon-filetype-folder {' .
|
2016-08-14 10:54:06 +00:00
|
|
|
'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
|
|
|
|
'.icon-filetype-folder-drag-accept {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
|
2016-07-19 12:39:53 +00:00
|
|
|
|
2016-06-21 19:21:46 +00:00
|
|
|
$expected->cacheFor(3600);
|
2016-07-28 14:07:23 +00:00
|
|
|
$expected->addHeader('Expires', date(\DateTime::RFC2822, 123));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2016-06-21 19:21:46 +00:00
|
|
|
@$this->assertEquals($expected, $this->themingController->getStylesheet());
|
|
|
|
}
|
2016-07-28 09:45:42 +00:00
|
|
|
|
2016-07-15 12:04:19 +00:00
|
|
|
public function testGetStylesheetWithAllCombinedInverted() {
|
2016-07-28 09:45:42 +00:00
|
|
|
|
|
|
|
$color = '#fff';
|
2016-08-10 20:06:36 +00:00
|
|
|
$elementColor = '#555555';
|
2016-07-28 09:45:42 +00:00
|
|
|
|
2016-07-15 12:04:19 +00:00
|
|
|
$this->config
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'cachebuster', '0')
|
|
|
|
->willReturn('0');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'color', '')
|
|
|
|
->willReturn('#fff');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(2))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'logoMime', '')
|
|
|
|
->willReturn('text/svg');
|
|
|
|
$this->config
|
|
|
|
->expects($this->at(3))
|
|
|
|
->method('getAppValue')
|
|
|
|
->with('theming', 'backgroundMime', '')
|
|
|
|
->willReturn('image/png');
|
|
|
|
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData = sprintf(
|
|
|
|
'#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: %s}' . "\n",
|
|
|
|
$color);
|
|
|
|
|
|
|
|
$expectedData .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' .
|
2016-07-25 14:44:56 +00:00
|
|
|
'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' .
|
2016-07-28 09:45:42 +00:00
|
|
|
'background-color: #555555; background-position: center center; background-size:contain;' .
|
2016-11-16 12:44:45 +00:00
|
|
|
'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' .
|
2016-07-25 14:44:56 +00:00
|
|
|
"}\n",
|
2016-07-28 09:45:42 +00:00
|
|
|
\OC::$WEBROOT
|
2016-07-25 14:44:56 +00:00
|
|
|
);
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' .
|
2016-07-28 14:07:23 +00:00
|
|
|
'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton('#555555').'\');' .
|
2016-07-25 15:32:11 +00:00
|
|
|
"}\n";
|
2016-08-08 13:06:17 +00:00
|
|
|
$expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' .
|
2016-08-29 17:07:27 +00:00
|
|
|
'.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active {' .
|
|
|
|
'border: 1px solid '.$elementColor.';'.
|
|
|
|
'background-color: '.$elementColor.';'.
|
|
|
|
'color: #000000;'.
|
2016-08-08 13:06:17 +00:00
|
|
|
"}\n" .
|
|
|
|
'.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' .
|
|
|
|
'.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' .
|
2016-08-29 17:07:27 +00:00
|
|
|
'border: 1px solid '.$elementColor.';'.
|
|
|
|
'background-color: '.$elementColor.';'.
|
|
|
|
'color: #000000;'.
|
|
|
|
"}\n" .
|
|
|
|
'.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' .
|
|
|
|
'.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' .
|
|
|
|
'.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' .
|
|
|
|
'border: 1px solid '.$elementColor.';'.
|
|
|
|
'background-color: '.$elementColor.';'.
|
|
|
|
'opacity: 0.4;' .
|
|
|
|
'color: #000000;'.
|
2016-08-08 13:06:17 +00:00
|
|
|
"}\n";
|
2016-08-10 20:06:36 +00:00
|
|
|
$expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n";
|
|
|
|
$expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' .
|
|
|
|
'border: 1px solid ' . $color . ';' .
|
|
|
|
'color: ' . $elementColor . ';' .
|
|
|
|
"}\n";
|
|
|
|
$expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' .
|
|
|
|
'color: ' . $elementColor . ';' .
|
|
|
|
"}\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= '
|
|
|
|
#firstrunwizard .firstrunwizard-header {
|
2016-08-01 06:39:40 +00:00
|
|
|
background-color: ' . $color . ';
|
2016-07-28 09:45:42 +00:00
|
|
|
}
|
|
|
|
#firstrunwizard p a {
|
2016-08-01 06:39:40 +00:00
|
|
|
color: ' . $color . ';
|
2016-07-28 09:45:42 +00:00
|
|
|
}
|
|
|
|
';
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= sprintf('.nc-theming-main-background {background-color: %s}' . "\n", $color);
|
|
|
|
$expectedData .= sprintf('.nc-theming-main-text {color: %s}' . "\n", $color);
|
2017-01-19 03:42:50 +00:00
|
|
|
$expectedData .= sprintf('#app-navigation li:hover > a, #app-navigation li:focus > a, #app-navigation a:focus, #app-navigation .selected, #app-navigation .selected a, #app-navigation .active, #app-navigation .active a {box-shadow: inset 2px 0 %s}' . "\n", $color);
|
2016-07-28 09:45:42 +00:00
|
|
|
$expectedData .= sprintf(
|
|
|
|
'#header .logo {' .
|
2016-08-01 06:39:40 +00:00
|
|
|
'background-image: url(\'./logo?v=0\');' .
|
2016-07-19 12:39:53 +00:00
|
|
|
'background-size: contain;' .
|
2016-07-28 09:45:42 +00:00
|
|
|
'}' . "\n" .
|
2016-07-19 12:39:53 +00:00
|
|
|
'#header .logo-icon {' .
|
|
|
|
'background-image: url(\'./logo?v=0\');' .
|
|
|
|
'background-size: contain;' .
|
2016-07-28 09:45:42 +00:00
|
|
|
'}' . "\n" .
|
|
|
|
'#firstrunwizard .firstrunwizard-header .logo {' .
|
|
|
|
'background-image: url(\'./logo?v=0\');' .
|
|
|
|
'background-size: contain;' .
|
|
|
|
'}' . "\n"
|
|
|
|
);
|
|
|
|
$expectedData .= '#body-login {background-image: url(\'./loginbackground?v=0\');}' . "\n";
|
2016-07-28 14:32:39 +00:00
|
|
|
$expectedData .= '#firstrunwizard .firstrunwizard-header {' .
|
2016-07-28 09:45:42 +00:00
|
|
|
'background-image: url(\'./loginbackground?v=0\');' .
|
|
|
|
'}' . "\n";
|
|
|
|
$expectedData .= '#header .header-appname, #expandDisplayName { color: #000000; }' . "\n";
|
|
|
|
$expectedData .= '#header .icon-caret { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/caret-dark.svg\'); }' . "\n";
|
|
|
|
$expectedData .= '.searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }' . "\n";
|
|
|
|
$expectedData .= '.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid { color: #000; border: 1px solid rgba(0, 0, 0, .5); }' . "\n";
|
2016-10-25 12:24:24 +00:00
|
|
|
$expectedData .= '#body-login input.login { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/confirm.svg?v=2\'); }' . "\n";
|
2016-08-09 20:54:25 +00:00
|
|
|
$expectedData .= '.nc-theming-contrast {color: #000000}' . "\n";
|
2016-08-10 20:06:36 +00:00
|
|
|
$expectedData .= '.ui-widget-header { color: #000000; }' . "\n";
|
2016-08-14 10:54:06 +00:00
|
|
|
$expectedData .= '.icon-file,.icon-filetype-text {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
|
2016-10-17 12:51:31 +00:00
|
|
|
'.icon-folder, .icon-filetype-folder {' .
|
2016-08-14 10:54:06 +00:00
|
|
|
'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
|
|
|
|
'.icon-filetype-folder-drag-accept {' .
|
|
|
|
'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
|
2016-07-28 09:45:42 +00:00
|
|
|
|
2016-08-10 20:06:36 +00:00
|
|
|
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
|
2016-07-15 12:04:19 +00:00
|
|
|
$expected->cacheFor(3600);
|
2016-07-28 14:07:23 +00:00
|
|
|
$expected->addHeader('Expires', date(\DateTime::RFC2822, 123));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2016-07-15 12:04:19 +00:00
|
|
|
@$this->assertEquals($expected, $this->themingController->getStylesheet());
|
|
|
|
}
|
2016-08-10 09:53:33 +00:00
|
|
|
|
|
|
|
public function testGetJavascript() {
|
|
|
|
$this->template
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getName')
|
|
|
|
->willReturn("");
|
|
|
|
$this->template
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getBaseUrl')
|
|
|
|
->willReturn("");
|
|
|
|
$this->template
|
|
|
|
->expects($this->at(2))
|
|
|
|
->method('getSlogan')
|
|
|
|
->willReturn("");
|
|
|
|
$this->template
|
|
|
|
->expects($this->at(3))
|
|
|
|
->method('getMailHeaderColor')
|
|
|
|
->willReturn("#000");
|
|
|
|
|
|
|
|
|
|
|
|
$expectedResponse = '(function() {
|
|
|
|
OCA.Theming = {
|
|
|
|
name: "",
|
|
|
|
url: "",
|
|
|
|
slogan: "",
|
|
|
|
color: "#000",
|
|
|
|
inverted: false,
|
2016-08-30 09:51:48 +00:00
|
|
|
cacheBuster: null
|
2016-08-10 09:53:33 +00:00
|
|
|
};
|
|
|
|
})();';
|
2017-01-18 16:00:09 +00:00
|
|
|
$expected = new Http\DataDownloadResponse($expectedResponse, 'javascript', 'text/javascript');
|
2016-08-10 09:53:33 +00:00
|
|
|
$expected->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2016-08-10 09:53:33 +00:00
|
|
|
$expected->cacheFor(3600);
|
|
|
|
@$this->assertEquals($expected, $this->themingController->getJavascript());
|
|
|
|
}
|
|
|
|
public function testGetJavascriptInverted() {
|
|
|
|
$this->template
|
|
|
|
->expects($this->at(0))
|
|
|
|
->method('getName')
|
|
|
|
->willReturn("Nextcloud");
|
|
|
|
$this->template
|
|
|
|
->expects($this->at(1))
|
|
|
|
->method('getBaseUrl')
|
|
|
|
->willReturn("nextcloudurl");
|
|
|
|
$this->template
|
|
|
|
->expects($this->at(2))
|
|
|
|
->method('getSlogan')
|
|
|
|
->willReturn("awesome");
|
|
|
|
$this->template
|
|
|
|
->expects($this->any())
|
|
|
|
->method('getMailHeaderColor')
|
|
|
|
->willReturn("#ffffff");
|
|
|
|
|
|
|
|
$expectedResponse = '(function() {
|
|
|
|
OCA.Theming = {
|
|
|
|
name: "Nextcloud",
|
|
|
|
url: "nextcloudurl",
|
|
|
|
slogan: "awesome",
|
|
|
|
color: "#ffffff",
|
|
|
|
inverted: true,
|
2016-08-30 09:51:48 +00:00
|
|
|
cacheBuster: null
|
2016-08-10 09:53:33 +00:00
|
|
|
};
|
|
|
|
})();';
|
2017-01-18 16:00:09 +00:00
|
|
|
$expected = new Http\DataDownloadResponse($expectedResponse, 'javascript', 'text/javascript');
|
2016-08-10 09:53:33 +00:00
|
|
|
$expected->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
|
2016-08-27 10:38:15 +00:00
|
|
|
$expected->addHeader('Pragma', 'cache');
|
2016-08-10 09:53:33 +00:00
|
|
|
$expected->cacheFor(3600);
|
|
|
|
@$this->assertEquals($expected, $this->themingController->getJavascript());
|
|
|
|
}
|
2016-06-21 19:21:46 +00:00
|
|
|
}
|