From 7a17994b1af7e02e61aaacd751ba7252405bf8ef Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 17 Sep 2021 06:01:48 -0300 Subject: Change from willReturnCallback to willReturnMap Signed-off-by: Vitor Mattos --- .../BackgroundJob/CheckHostedSignalingServerTest.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/php/BackgroundJob/CheckHostedSignalingServerTest.php b/tests/php/BackgroundJob/CheckHostedSignalingServerTest.php index 5bc392488..b8cd73c21 100644 --- a/tests/php/BackgroundJob/CheckHostedSignalingServerTest.php +++ b/tests/php/BackgroundJob/CheckHostedSignalingServerTest.php @@ -83,12 +83,10 @@ class CheckHostedSignalingServerTest extends TestCase { $this->config ->method('getAppValue') - ->willReturnCallback(function ($appid, $key, $default) { - switch ($key) { - case 'hosted-signaling-server-account-id': return 'my-account-id'; - case 'hosted-signaling-server-account': return '{"status": "pending"}'; - } - }); + ->will($this->returnValueMap([ + ['spreed', 'hosted-signaling-server-account-id', '', 'my-account-id'], + ['spreed', 'hosted-signaling-server-account', '{}', '{"status": "pending"}'] + ])); $this->config->expects($this->once()) ->method('setAppValue') ->with('spreed', 'hosted-signaling-server-account-last-checked', null); @@ -112,12 +110,10 @@ class CheckHostedSignalingServerTest extends TestCase { $this->config ->method('getAppValue') - ->willReturnCallback(function ($appid, $key, $default) { - switch ($key) { - case 'hosted-signaling-server-account-id': return 'my-account-id'; - case 'hosted-signaling-server-account': return '{"status": "pending"}'; - } - }); + ->will($this->returnValueMap([ + ['spreed', 'hosted-signaling-server-account-id', '', 'my-account-id'], + ['spreed', 'hosted-signaling-server-account', '{}', '{"status": "pending"}'] + ])); $this->config->expects($this->exactly(4)) ->method('setAppValue') ->withConsecutive( -- cgit v1.2.3