Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-08-11 19:02:23 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-08-11 19:02:23 +0300
commit13ca01ee1256dba54d1e2793bd409d3b7c8d6058 (patch)
treeabede987494360419201f2ca2a79d4f464a70e5c /apps/theming/tests
parenta61331f4560468e6d433cf32e008b157b06e7ea9 (diff)
Fix unit tests for the theming app
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/theming/tests')
-rw-r--r--apps/theming/tests/ImageManagerTest.php2
-rw-r--r--apps/theming/tests/Themes/DefaultThemeTest.php19
2 files changed, 19 insertions, 2 deletions
diff --git a/apps/theming/tests/ImageManagerTest.php b/apps/theming/tests/ImageManagerTest.php
index 6a9b77234bb..0f22a774a39 100644
--- a/apps/theming/tests/ImageManagerTest.php
+++ b/apps/theming/tests/ImageManagerTest.php
@@ -307,7 +307,7 @@ class ImageManagerTest extends TestCase {
foreach ($folders as $index => $folder) {
$folder->expects($this->any())
->method('getName')
- ->willReturn($index);
+ ->willReturn((string)$index);
}
$folders[0]->expects($this->once())->method('delete');
$folders[1]->expects($this->once())->method('delete');
diff --git a/apps/theming/tests/Themes/DefaultThemeTest.php b/apps/theming/tests/Themes/DefaultThemeTest.php
index 160efdba142..5086c5da8ee 100644
--- a/apps/theming/tests/Themes/DefaultThemeTest.php
+++ b/apps/theming/tests/Themes/DefaultThemeTest.php
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-namespace OCA\Theming\Tests\Service;
+namespace OCA\Theming\Tests;
use OC\App\AppManager;
use OCA\Theming\ImageManager;
@@ -68,6 +68,23 @@ class DefaultThemeTest extends TestCase {
->method('getColorPrimary')
->willReturn('#0082c9');
+ $this->imageManager->expects($this->any())
+ ->method('getImageUrl')
+ ->willReturnCallback(function (string $name): string {
+ switch ($name) {
+ case 'logo':
+ case 'logoheader':
+ case 'favicon':
+ return '/core/img/logo/logo.png?v=0';
+ case 'background':
+ case 'login-background':
+ return '/core/img/background.png?v=0';
+ default:
+ return '';
+ }
+ });
+
+
$this->l10n
->expects($this->any())
->method('t')