summaryrefslogtreecommitdiffstats
path: root/apps/theming/tests/Controller/ThemingControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming/tests/Controller/ThemingControllerTest.php')
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php50
1 files changed, 25 insertions, 25 deletions
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index 511f7a6d528..9042a338fb7 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -208,12 +208,12 @@ class ThemingControllerTest extends TestCase {
public function testUpdateLogoNoData() {
$this->request
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getParam')
->with('key')
->willReturn('logo');
$this->request
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getUploadedFile')
->with('image')
->willReturn(null);
@@ -251,12 +251,12 @@ class ThemingControllerTest extends TestCase {
->willReturn(false);
$this->request
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getParam')
->with('key')
->willReturn('favicon');
$this->request
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getUploadedFile')
->with('image')
->willReturn([
@@ -292,12 +292,12 @@ class ThemingControllerTest extends TestCase {
public function testUpdateLogoInvalidMimeType() {
$this->request
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getParam')
->with('key')
->willReturn('logo');
$this->request
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getUploadedFile')
->with('image')
->willReturn([
@@ -350,12 +350,12 @@ class ThemingControllerTest extends TestCase {
touch($tmpLogo);
copy(__DIR__ . '/../../../../tests/data/testimage.png', $tmpLogo);
$this->request
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getParam')
->with('key')
->willReturn('logo');
$this->request
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getUploadedFile')
->with('image')
->willReturn([
@@ -401,12 +401,12 @@ class ThemingControllerTest extends TestCase {
touch($tmpLogo);
copy(__DIR__ . '/../../../../tests/data/desktopapp.png', $tmpLogo);
$this->request
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getParam')
->with('key')
->willReturn('background');
$this->request
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getUploadedFile')
->with('image')
->willReturn([
@@ -449,12 +449,12 @@ class ThemingControllerTest extends TestCase {
touch($tmpLogo);
file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/data.zip'));
$this->request
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getParam')
->with('key')
->willReturn('logo');
$this->request
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getUploadedFile')
->with('image')
->willReturn([
@@ -504,12 +504,12 @@ class ThemingControllerTest extends TestCase {
*/
public function testUpdateLogoLoginScreenUploadWithInvalidImageUpload($error, $expectedErrorMessage) {
$this->request
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getParam')
->with('key')
->willReturn('background');
$this->request
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getUploadedFile')
->with('image')
->willReturn([
@@ -543,12 +543,12 @@ class ThemingControllerTest extends TestCase {
*/
public function testUpdateLogoUploadWithInvalidImageUpload($error, $expectedErrorMessage) {
$this->request
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getParam')
->with('key')
->willReturn('background');
$this->request
- ->expects($this->at(1))
+ ->expects($this->once())
->method('getUploadedFile')
->with('image')
->willReturn([
@@ -713,19 +713,19 @@ class ThemingControllerTest extends TestCase {
->method('getName')
->willReturn('Nextcloud');
$this->urlGenerator
- ->expects($this->at(0))
+ ->expects($this->once())
->method('getBaseUrl')
->willReturn('localhost');
$this->urlGenerator
- ->expects($this->at(1))
+ ->expects($this->exactly(2))
->method('linkToRoute')
- ->with('theming.Icon.getTouchIcon', ['app' => 'core'])
- ->willReturn('touchicon');
- $this->urlGenerator
- ->expects($this->at(2))
- ->method('linkToRoute')
- ->with('theming.Icon.getFavicon', ['app' => 'core'])
- ->willReturn('favicon');
+ ->withConsecutive(
+ ['theming.Icon.getTouchIcon', ['app' => 'core']],
+ ['theming.Icon.getFavicon', ['app' => 'core']],
+ )->willReturnOnConsecutiveCalls(
+ 'touchicon',
+ 'favicon',
+ );
$response = new Http\JSONResponse([
'name' => 'Nextcloud',
'start_url' => 'localhost',