summaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/l10n/ca.js9
-rw-r--r--apps/theming/l10n/ca.json9
-rw-r--r--apps/theming/l10n/cs.js2
-rw-r--r--apps/theming/l10n/cs.json2
-rw-r--r--apps/theming/l10n/es_GT.js11
-rw-r--r--apps/theming/l10n/es_GT.json11
-rw-r--r--apps/theming/l10n/ka_GE.js2
-rw-r--r--apps/theming/l10n/ka_GE.json2
-rw-r--r--apps/theming/l10n/lt_LT.js2
-rw-r--r--apps/theming/l10n/lt_LT.json2
-rw-r--r--apps/theming/l10n/sk.js2
-rw-r--r--apps/theming/l10n/sk.json2
-rw-r--r--apps/theming/lib/Controller/ThemingController.php6
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php15
-rw-r--r--apps/theming/tests/IconBuilderTest.php16
15 files changed, 68 insertions, 25 deletions
diff --git a/apps/theming/l10n/ca.js b/apps/theming/l10n/ca.js
index f0b24291eda..2e1b7f73bce 100644
--- a/apps/theming/l10n/ca.js
+++ b/apps/theming/l10n/ca.js
@@ -5,14 +5,16 @@ OC.L10N.register(
"Saved" : "Guardat",
"Admin" : "Admin",
"a safe home for all your data" : "un lloc segur per a les teves dades",
+ "Name cannot be empty" : "El nom del fitxer no pot estar buit",
"The given name is too long" : "El nom introduït és massa llarg",
"The given web address is too long" : "L'adreça web proporcionada és massa llarga",
"The given slogan is too long" : "El lema indicat és massa llarg",
"The given color is invalid" : "El color donat no és vàlid",
"No file uploaded" : "No s'ha carregat cap fitxer",
"Unsupported image type" : "Tipus d'imatge no compatible",
- "Theming" : "Adaptació de temes",
- "Theming makes it possible to easily customize the look and feel of your instance and supported clients. This will be visible for all users." : "L'adaptació de temes permet personalitzar fàcilment l'aspecte de la vostra instància i els clients compatibles. Això serà visible per a tots els usuaris.",
+ "You are already using a custom theme. Theming app settings might be overwritten by that." : "Ja estàs utilitzant un tema propi. La configuració de l'app s'hauria d'haver modificat.",
+ "Theming" : "Aparença",
+ "Theming makes it possible to easily customize the look and feel of your instance and supported clients. This will be visible for all users." : "La personalització permet canviar fàcilment l'aspecte de la vostra web i dels clients. Això serà visible per a tots els usuaris.",
"Name" : "Nom",
"Reset to default" : "Restablir al valor predeterminat",
"Web address" : "Adreça web",
@@ -24,6 +26,9 @@ OC.L10N.register(
"Login image" : "Login logo",
"Upload new login background" : "Carregar nou fons d'inici de sessió",
"Remove background image" : "Elimina la imatge de fons",
+ "Header logo" : "Logo de capçalera",
+ "Upload new header logo" : "Pujar un nou logo de capçalera",
+ "Install the Imagemagick PHP extension with support for SVG images to automatically generate favicons based on the uploaded logo and color." : "Instal·la l'extensió Imagemagick per al PHP i es generarà automàticament un favicon a partir del logo i del color del tema.",
"You are already using a custom theme" : "Ja esteu utilitzant un tema personalitzat",
"reset to default" : "restablir a configuració predeterminada"
},
diff --git a/apps/theming/l10n/ca.json b/apps/theming/l10n/ca.json
index c26241baaf4..062b7776248 100644
--- a/apps/theming/l10n/ca.json
+++ b/apps/theming/l10n/ca.json
@@ -3,14 +3,16 @@
"Saved" : "Guardat",
"Admin" : "Admin",
"a safe home for all your data" : "un lloc segur per a les teves dades",
+ "Name cannot be empty" : "El nom del fitxer no pot estar buit",
"The given name is too long" : "El nom introduït és massa llarg",
"The given web address is too long" : "L'adreça web proporcionada és massa llarga",
"The given slogan is too long" : "El lema indicat és massa llarg",
"The given color is invalid" : "El color donat no és vàlid",
"No file uploaded" : "No s'ha carregat cap fitxer",
"Unsupported image type" : "Tipus d'imatge no compatible",
- "Theming" : "Adaptació de temes",
- "Theming makes it possible to easily customize the look and feel of your instance and supported clients. This will be visible for all users." : "L'adaptació de temes permet personalitzar fàcilment l'aspecte de la vostra instància i els clients compatibles. Això serà visible per a tots els usuaris.",
+ "You are already using a custom theme. Theming app settings might be overwritten by that." : "Ja estàs utilitzant un tema propi. La configuració de l'app s'hauria d'haver modificat.",
+ "Theming" : "Aparença",
+ "Theming makes it possible to easily customize the look and feel of your instance and supported clients. This will be visible for all users." : "La personalització permet canviar fàcilment l'aspecte de la vostra web i dels clients. Això serà visible per a tots els usuaris.",
"Name" : "Nom",
"Reset to default" : "Restablir al valor predeterminat",
"Web address" : "Adreça web",
@@ -22,6 +24,9 @@
"Login image" : "Login logo",
"Upload new login background" : "Carregar nou fons d'inici de sessió",
"Remove background image" : "Elimina la imatge de fons",
+ "Header logo" : "Logo de capçalera",
+ "Upload new header logo" : "Pujar un nou logo de capçalera",
+ "Install the Imagemagick PHP extension with support for SVG images to automatically generate favicons based on the uploaded logo and color." : "Instal·la l'extensió Imagemagick per al PHP i es generarà automàticament un favicon a partir del logo i del color del tema.",
"You are already using a custom theme" : "Ja esteu utilitzant un tema personalitzat",
"reset to default" : "restablir a configuració predeterminada"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
diff --git a/apps/theming/l10n/cs.js b/apps/theming/l10n/cs.js
index 3d56fef0d2e..98ceb010505 100644
--- a/apps/theming/l10n/cs.js
+++ b/apps/theming/l10n/cs.js
@@ -37,4 +37,4 @@ OC.L10N.register(
"Failed to write file to disk." : "Selhal zápis na disk",
"A PHP extension stopped the file upload." : "Rozšíření PHP zastavilo nahrávání souboru."
},
-"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;");
+"nplurals=4; plural=(n < 10 && n % 1 == 0) ? 1 : (n < 9999 && n >= 10 && n % 1 == 0) ? 3 : (n % 1 != 0) : 4;");
diff --git a/apps/theming/l10n/cs.json b/apps/theming/l10n/cs.json
index 6040528d3da..e33d584fce9 100644
--- a/apps/theming/l10n/cs.json
+++ b/apps/theming/l10n/cs.json
@@ -34,5 +34,5 @@
"The uploaded file was only partially uploaded" : "Nahraný soubor byl nahrán pouze částečně",
"Failed to write file to disk." : "Selhal zápis na disk",
"A PHP extension stopped the file upload." : "Rozšíření PHP zastavilo nahrávání souboru."
-},"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"
+},"pluralForm" :"nplurals=4; plural=(n < 10 && n % 1 == 0) ? 1 : (n < 9999 && n >= 10 && n % 1 == 0) ? 3 : (n % 1 != 0) : 4;"
} \ No newline at end of file
diff --git a/apps/theming/l10n/es_GT.js b/apps/theming/l10n/es_GT.js
index a5c28e1ee77..bee78be90cc 100644
--- a/apps/theming/l10n/es_GT.js
+++ b/apps/theming/l10n/es_GT.js
@@ -5,16 +5,22 @@ OC.L10N.register(
"Saved" : "Guardado",
"Admin" : "Administración",
"a safe home for all your data" : "un lugar seguro para todos tus datos",
+ "Name cannot be empty" : "El nombre no puede estar en blanco",
"The given name is too long" : "El nombre dado es demasiado largo",
"The given web address is too long" : "La dirección web dada es demasiado larga",
"The given slogan is too long" : "El lema dado es demasiado largo",
"The given color is invalid" : "El color dado es inválido",
+ "The file was uploaded" : "El archivo fue cargado",
"The uploaded file exceeds the upload_max_filesize directive in php.ini" : "El archivo cargado excede el valor establecido en la directiva upload_max_filesize en el archivo php.ini",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" : "El archivo cargado excede el valor especificado de la directiva MAX_FILE_SIZE en la forma de HTML",
+ "The file was only partially uploaded" : "El archivo sólo fue cargado parcialmente",
"No file was uploaded" : "No se cargó el archivo",
"Missing a temporary folder" : "Falta una carpeta temporal",
+ "Could not write file to disk" : "No fue posible escribir a disco",
+ "A PHP extension stopped the file upload" : "Una extensión de PHP detuvo la carga del archivo",
"No file uploaded" : "No hay archivos cargados",
"Unsupported image type" : "Tipo de imagen no soportado",
+ "You are already using a custom theme. Theming app settings might be overwritten by that." : "Ya te encuentras usando un tema personalizado. La aplicación de Temas puede estar siendo sobreescrita por él.",
"Theming" : "Tematizar",
"Theming makes it possible to easily customize the look and feel of your instance and supported clients. This will be visible for all users." : "El tematizar hace posible personalizar facilmente la manera en que se ve tu instancia y clientes soportados. Esto será visible para todos los usuarios. ",
"Name" : "Nombre",
@@ -28,6 +34,11 @@ OC.L10N.register(
"Login image" : "Imágen de inicio de sesión",
"Upload new login background" : "Cargar nueva imagen de fondo para inicio de sesión",
"Remove background image" : "Eliminar imagen de fondo",
+ "Advanced options" : "Opciones avanzadas",
+ "Header logo" : "Logo del encabezado",
+ "Upload new header logo" : "Cargar un nuevo logotipo del encabezado",
+ "Favicon" : "Favicon",
+ "Upload new favicon" : "Cargar un nuevo favicon",
"Install the Imagemagick PHP extension with support for SVG images to automatically generate favicons based on the uploaded logo and color." : "Instala la extensión Imagemagick de PHP con soporte a imagenes SVG para generar los favicons en automático con base en el logotipo cargado y el color.",
"You are already using a custom theme" : "Ya estás usando un tema personalizado",
"reset to default" : "restaurar a predeterminado",
diff --git a/apps/theming/l10n/es_GT.json b/apps/theming/l10n/es_GT.json
index 6099c9a9c1e..84e7927dda8 100644
--- a/apps/theming/l10n/es_GT.json
+++ b/apps/theming/l10n/es_GT.json
@@ -3,16 +3,22 @@
"Saved" : "Guardado",
"Admin" : "Administración",
"a safe home for all your data" : "un lugar seguro para todos tus datos",
+ "Name cannot be empty" : "El nombre no puede estar en blanco",
"The given name is too long" : "El nombre dado es demasiado largo",
"The given web address is too long" : "La dirección web dada es demasiado larga",
"The given slogan is too long" : "El lema dado es demasiado largo",
"The given color is invalid" : "El color dado es inválido",
+ "The file was uploaded" : "El archivo fue cargado",
"The uploaded file exceeds the upload_max_filesize directive in php.ini" : "El archivo cargado excede el valor establecido en la directiva upload_max_filesize en el archivo php.ini",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" : "El archivo cargado excede el valor especificado de la directiva MAX_FILE_SIZE en la forma de HTML",
+ "The file was only partially uploaded" : "El archivo sólo fue cargado parcialmente",
"No file was uploaded" : "No se cargó el archivo",
"Missing a temporary folder" : "Falta una carpeta temporal",
+ "Could not write file to disk" : "No fue posible escribir a disco",
+ "A PHP extension stopped the file upload" : "Una extensión de PHP detuvo la carga del archivo",
"No file uploaded" : "No hay archivos cargados",
"Unsupported image type" : "Tipo de imagen no soportado",
+ "You are already using a custom theme. Theming app settings might be overwritten by that." : "Ya te encuentras usando un tema personalizado. La aplicación de Temas puede estar siendo sobreescrita por él.",
"Theming" : "Tematizar",
"Theming makes it possible to easily customize the look and feel of your instance and supported clients. This will be visible for all users." : "El tematizar hace posible personalizar facilmente la manera en que se ve tu instancia y clientes soportados. Esto será visible para todos los usuarios. ",
"Name" : "Nombre",
@@ -26,6 +32,11 @@
"Login image" : "Imágen de inicio de sesión",
"Upload new login background" : "Cargar nueva imagen de fondo para inicio de sesión",
"Remove background image" : "Eliminar imagen de fondo",
+ "Advanced options" : "Opciones avanzadas",
+ "Header logo" : "Logo del encabezado",
+ "Upload new header logo" : "Cargar un nuevo logotipo del encabezado",
+ "Favicon" : "Favicon",
+ "Upload new favicon" : "Cargar un nuevo favicon",
"Install the Imagemagick PHP extension with support for SVG images to automatically generate favicons based on the uploaded logo and color." : "Instala la extensión Imagemagick de PHP con soporte a imagenes SVG para generar los favicons en automático con base en el logotipo cargado y el color.",
"You are already using a custom theme" : "Ya estás usando un tema personalizado",
"reset to default" : "restaurar a predeterminado",
diff --git a/apps/theming/l10n/ka_GE.js b/apps/theming/l10n/ka_GE.js
index 9ced9526a92..3306aae65f0 100644
--- a/apps/theming/l10n/ka_GE.js
+++ b/apps/theming/l10n/ka_GE.js
@@ -37,4 +37,4 @@ OC.L10N.register(
"Failed to write file to disk." : "ფაილი დისკზე ვერ ჩაიწერა.",
"A PHP extension stopped the file upload." : "PHP გაფართოებამ შეაჩერა ფაილის ატვირთვა."
},
-"nplurals=1; plural=0;");
+"nplurals=2; plural=(n==1);");
diff --git a/apps/theming/l10n/ka_GE.json b/apps/theming/l10n/ka_GE.json
index 4f9c81895ea..2d9d9480be7 100644
--- a/apps/theming/l10n/ka_GE.json
+++ b/apps/theming/l10n/ka_GE.json
@@ -34,5 +34,5 @@
"The uploaded file was only partially uploaded" : "ფაილი აიტვირთა მხოლოდ ნაწილობრივ",
"Failed to write file to disk." : "ფაილი დისკზე ვერ ჩაიწერა.",
"A PHP extension stopped the file upload." : "PHP გაფართოებამ შეაჩერა ფაილის ატვირთვა."
-},"pluralForm" :"nplurals=1; plural=0;"
+},"pluralForm" :"nplurals=2; plural=(n==1);"
} \ No newline at end of file
diff --git a/apps/theming/l10n/lt_LT.js b/apps/theming/l10n/lt_LT.js
index 4d5bacf2817..7ef208f86db 100644
--- a/apps/theming/l10n/lt_LT.js
+++ b/apps/theming/l10n/lt_LT.js
@@ -42,4 +42,4 @@ OC.L10N.register(
"Failed to write file to disk." : "Nepavyko įrašyti failą į diską.",
"A PHP extension stopped the file upload." : "PHP plėtinys sustabdė failo įkėlimą."
},
-"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);");
+"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 1 : (n%10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 3 : n % 1 != 0 ? 4);");
diff --git a/apps/theming/l10n/lt_LT.json b/apps/theming/l10n/lt_LT.json
index 2dd75243c9e..37d47827612 100644
--- a/apps/theming/l10n/lt_LT.json
+++ b/apps/theming/l10n/lt_LT.json
@@ -39,5 +39,5 @@
"The uploaded file was only partially uploaded" : "Įkeliamas failas buvo tik dalinai įkeltas",
"Failed to write file to disk." : "Nepavyko įrašyti failą į diską.",
"A PHP extension stopped the file upload." : "PHP plėtinys sustabdė failo įkėlimą."
-},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"
+},"pluralForm" :"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 1 : (n%10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 3 : n % 1 != 0 ? 4);"
} \ No newline at end of file
diff --git a/apps/theming/l10n/sk.js b/apps/theming/l10n/sk.js
index ef0c289d7a3..b3c5b8571a6 100644
--- a/apps/theming/l10n/sk.js
+++ b/apps/theming/l10n/sk.js
@@ -41,4 +41,4 @@ OC.L10N.register(
"Failed to write file to disk." : "Nepodarilo sa zapísať súbor na disk.",
"A PHP extension stopped the file upload." : "rozšírenie PHP zastavilo nahrávanie súboru."
},
-"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;");
+"nplurals=4; plural=(n % 1 == 0 ? 4: n==1 ? 1: n % 1 == 0 && n>=2 && n<=4 ? 3);");
diff --git a/apps/theming/l10n/sk.json b/apps/theming/l10n/sk.json
index 335ecfcc819..9a087a7c1f7 100644
--- a/apps/theming/l10n/sk.json
+++ b/apps/theming/l10n/sk.json
@@ -38,5 +38,5 @@
"The uploaded file was only partially uploaded" : "Ukladaný súbor sa nahral len čiastočne",
"Failed to write file to disk." : "Nepodarilo sa zapísať súbor na disk.",
"A PHP extension stopped the file upload." : "rozšírenie PHP zastavilo nahrávanie súboru."
-},"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"
+},"pluralForm" :"nplurals=4; plural=(n % 1 == 0 ? 4: n==1 ? 1: n % 1 == 0 && n>=2 && n<=4 ? 3);"
} \ No newline at end of file
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index 27daf756d48..dd7bf4bb04d 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -258,8 +258,9 @@ class ThemingController extends Controller {
}
$target = $folder->newFile($key);
- $supportedFormats = ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'text/svg'];
- if (!in_array($image['type'], $supportedFormats)) {
+ $supportedFormats = ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'image/svg'];
+ $detectedMimeType = mime_content_type($image['tmp_name']);
+ if (!in_array($image['type'], $supportedFormats) || !in_array($detectedMimeType, $supportedFormats)) {
return new DataResponse(
[
'data' => [
@@ -363,6 +364,7 @@ class ThemingController extends Controller {
$response->addHeader('Expires', $expires->format(\DateTime::RFC2822));
$response->addHeader('Pragma', 'cache');
$response->addHeader('Content-Type', $this->config->getAppValue($this->appName, $key . 'Mime', ''));
+ $response->addHeader('Content-Disposition', 'attachment; filename="' . $key . '"');
return $response;
}
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index f2f14e44a02..f196541d371 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -255,7 +255,7 @@ class ThemingControllerTest extends TestCase {
->method('getUploadedFile')
->with('image')
->willReturn([
- 'tmp_name' => 'logo.pdf',
+ 'tmp_name' => __DIR__ . '/../../../../tests/data/lorem.txt',
'type' => 'application/pdf',
'name' => 'logo.pdf',
'error' => 0,
@@ -295,7 +295,7 @@ class ThemingControllerTest extends TestCase {
['image/gif'],
['image/png'],
['image/svg+xml'],
- ['text/svg'],
+ ['image/svg']
];
}
@@ -305,6 +305,7 @@ class ThemingControllerTest extends TestCase {
$destination = \OC::$server->getTempManager()->getTemporaryFolder();
touch($tmpLogo);
+ copy(__DIR__ . '/../../../../tests/data/testimage.png', $tmpLogo);
$this->request
->expects($this->at(0))
->method('getParam')
@@ -377,10 +378,10 @@ class ThemingControllerTest extends TestCase {
/** @dataProvider dataUpdateImages */
public function testUpdateLogoLoginScreenUpload($folderExists) {
- $tmpLogo = \OC::$server->getTempManager()->getTemporaryFolder() . '/logo.svg';
+ $tmpLogo = \OC::$server->getTempManager()->getTemporaryFolder() . 'logo.png';
touch($tmpLogo);
- file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/desktopapp.png'));
+ copy(__DIR__ . '/../../../../tests/data/desktopapp.png', $tmpLogo);
$this->request
->expects($this->at(0))
->method('getParam')
@@ -392,7 +393,7 @@ class ThemingControllerTest extends TestCase {
->with('image')
->willReturn([
'tmp_name' => $tmpLogo,
- 'type' => 'text/svg',
+ 'type' => 'image/svg+xml',
'name' => 'logo.svg',
'error' => 0,
]);
@@ -524,7 +525,7 @@ class ThemingControllerTest extends TestCase {
->with('image')
->willReturn([
'tmp_name' => '',
- 'type' => 'text/svg',
+ 'type' => 'image/svg+xml',
'name' => 'logo.svg',
'error' => $error,
]);
@@ -700,6 +701,7 @@ class ThemingControllerTest extends TestCase {
$expected->addHeader('Expires', $expires->format(\DateTime::RFC2822));
$expected->addHeader('Pragma', 'cache');
$expected->addHeader('Content-Type', 'text/svg');
+ $expected->addHeader('Content-Disposition', 'attachment; filename="logo"');
@$this->assertEquals($expected, $this->themingController->getImage('logo'));
}
@@ -732,6 +734,7 @@ class ThemingControllerTest extends TestCase {
$expected->addHeader('Expires', $expires->format(\DateTime::RFC2822));
$expected->addHeader('Pragma', 'cache');
$expected->addHeader('Content-Type', 'image/png');
+ $expected->addHeader('Content-Disposition', 'attachment; filename="background"');
@$this->assertEquals($expected, $this->themingController->getImage('background'));
}
diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php
index a2a330a2f24..1b9f204cd9e 100644
--- a/apps/theming/tests/IconBuilderTest.php
+++ b/apps/theming/tests/IconBuilderTest.php
@@ -25,13 +25,11 @@
*/
namespace OCA\Theming\Tests;
+use OC\Files\AppData\AppData;
use OCA\Theming\IconBuilder;
use OCA\Theming\ThemingDefaults;
use OCA\Theming\Util;
use OCP\App\IAppManager;
-use OCP\AppFramework\Http\NotFoundResponse;
-use OCP\Files\IAppData;
-use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IConfig;
use PHPUnit\Framework\Error\Warning;
@@ -41,7 +39,7 @@ class IconBuilderTest extends TestCase {
/** @var IConfig */
protected $config;
- /** @var IAppData */
+ /** @var AppData */
protected $appData;
/** @var ThemingDefaults */
protected $themingDefaults;
@@ -56,7 +54,7 @@ class IconBuilderTest extends TestCase {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
- $this->appData = $this->createMock(IAppData::class);
+ $this->appData = $this->createMock(AppData::class);
$this->themingDefaults = $this->getMockBuilder('OCA\Theming\ThemingDefaults')
->disableOriginalConstructor()->getMock();
$this->appManager = $this->getMockBuilder('OCP\App\IAppManager')->getMock();
@@ -127,6 +125,10 @@ class IconBuilderTest extends TestCase {
$this->themingDefaults->expects($this->once())
->method('getColorPrimary')
->willReturn($color);
+ $this->appData->expects($this->once())
+ ->method('getFolder')
+ ->with('images')
+ ->willThrowException(new NotFoundException());
$expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file);
$icon = new \Imagick();
@@ -156,6 +158,10 @@ class IconBuilderTest extends TestCase {
$this->themingDefaults->expects($this->once())
->method('getColorPrimary')
->willReturn($color);
+ $this->appData->expects($this->once())
+ ->method('getFolder')
+ ->with('images')
+ ->willThrowException(new NotFoundException());
$expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file);
$actualIcon = $this->iconBuilder->getFavicon($app);