public function testUpdateLogoNoData() {
$this->request
->expects($this->at(0))
+ ->method('getParam')
+ ->with('backgroundColor')
+ ->willReturn(false);
+ $this->request
+ ->expects($this->at(1))
->method('getUploadedFile')
->with('uploadlogo')
->willReturn(null);
$this->request
- ->expects($this->at(1))
+ ->expects($this->at(2))
->method('getUploadedFile')
->with('upload-login-background')
->willReturn(null);
$this->assertEquals($expected, $this->themingController->updateLogo());
}
+ public function testUpdateBackgroundColor() {
+ $this->request
+ ->expects($this->at(0))
+ ->method('getParam')
+ ->with('backgroundColor')
+ ->willReturn(true);
+ $this->themingDefaults
+ ->expects($this->once())
+ ->method('set')
+ ->with('backgroundMime', 'backgroundColor');
+ $expected = new DataResponse(
+ [
+ 'data' =>
+ [
+ 'name' => 'backgroundColor',
+ 'message' => $this->l10n->t('Saved')
+ ],
+ 'status' => 'success'
+ ]
+ );
+ $this->assertEquals($expected, $this->themingController->updateLogo());
+ }
+
public function dataUpdateImages() {
return [
[false],
touch($tmpLogo);
$this->request
->expects($this->at(0))
+ ->method('getParam')
+ ->with('backgroundColor')
+ ->willReturn(false);
+ $this->request
+ ->expects($this->at(1))
->method('getUploadedFile')
->with('uploadlogo')
->willReturn([
'name' => 'logo.svg',
]);
$this->request
- ->expects($this->at(1))
+ ->expects($this->at(2))
->method('getUploadedFile')
->with('upload-login-background')
->willReturn(null);
file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/desktopapp.png'));
$this->request
->expects($this->at(0))
+ ->method('getParam')
+ ->with('backgroundColor')
+ ->willReturn(false);
+ $this->request
+ ->expects($this->at(1))
->method('getUploadedFile')
->with('uploadlogo')
->willReturn(null);
$this->request
- ->expects($this->at(1))
+ ->expects($this->at(2))
->method('getUploadedFile')
->with('upload-login-background')
->willReturn([
file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/data.zip'));
$this->request
->expects($this->at(0))
+ ->method('getParam')
+ ->with('backgroundColor')
+ ->willReturn(false);
+ $this->request
+ ->expects($this->at(1))
->method('getUploadedFile')
->with('uploadlogo')
->willReturn(null);
$this->request
- ->expects($this->at(1))
+ ->expects($this->at(2))
->method('getUploadedFile')
->with('upload-login-background')
->willReturn([
'image-logo' => "'absolute-custom-logo?v=0'",
'image-login-background' => "'absolute-custom-background?v=0'",
'color-primary' => $this->defaults->getColorPrimary(),
- 'color-primary-text' => '#ffffff'
+ 'color-primary-text' => '#ffffff',
+ 'image-login-plain' => 'false'
];
$this->assertEquals($expected, $this->template->getScssVariables());