diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-24 13:26:58 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-01-24 09:34:09 +0100 |
commit | a23cd7b961fc7c0d8d52cf2d914bdee36e2a40bc (patch) | |
tree | 208635ac91b56440923ab0d193cea62510eca708 /tests/Core/Controller/NavigationControllerTest.php | |
parent | f867a2d65e825800d6bf1b685659677f6136ac5f (diff) | |
download | nextcloud-server-a23cd7b961fc7c0d8d52cf2d914bdee36e2a40bc.tar.gz nextcloud-server-a23cd7b961fc7c0d8d52cf2d914bdee36e2a40bc.zip |
Fix a bunch of deprecation in the phpunit for core
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'tests/Core/Controller/NavigationControllerTest.php')
-rw-r--r-- | tests/Core/Controller/NavigationControllerTest.php | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php index 39f389faa5e..ddf307ec06d 100644 --- a/tests/Core/Controller/NavigationControllerTest.php +++ b/tests/Core/Controller/NavigationControllerTest.php @@ -74,14 +74,13 @@ class NavigationControllerTest extends TestCase { $this->urlGenerator->expects($this->any()) ->method('getBaseURL') ->willReturn('http://localhost/'); - $this->urlGenerator->expects($this->at(1)) + $this->urlGenerator->expects($this->exactly(2)) ->method('getAbsoluteURL') - ->with('/index.php/apps/files') - ->willReturn('http://localhost/index.php/apps/files'); - $this->urlGenerator->expects($this->at(3)) - ->method('getAbsoluteURL') - ->with('icon') - ->willReturn('http://localhost/icon'); + ->withConsecutive(['/index.php/apps/files'], ['icon']) + ->willReturnOnConsecutiveCalls( + 'http://localhost/index.php/apps/files', + 'http://localhost/icon' + ); $actual = $this->controller->getAppsNavigation($absolute); $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('http://localhost/index.php/apps/files', $actual->getData()[0]['href']); @@ -104,14 +103,16 @@ class NavigationControllerTest extends TestCase { $this->urlGenerator->expects($this->any()) ->method('getBaseURL') ->willReturn('http://localhost/'); - $this->urlGenerator->expects($this->at(1)) - ->method('getAbsoluteURL') - ->with('/index.php/settings/user') - ->willReturn('http://localhost/index.php/settings/user'); - $this->urlGenerator->expects($this->at(3)) + $this->urlGenerator->expects($this->exactly(2)) ->method('getAbsoluteURL') - ->with('/core/img/settings.svg') - ->willReturn('http://localhost/core/img/settings.svg'); + ->withConsecutive( + ['/index.php/settings/user'], + ['/core/img/settings.svg'] + ) + ->willReturnOnConsecutiveCalls( + 'http://localhost/index.php/settings/user', + 'http://localhost/core/img/settings.svg' + ); $actual = $this->controller->getSettingsNavigation($absolute); $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('http://localhost/index.php/settings/user', $actual->getData()[0]['href']); |