diff options
author | Vitor Mattos <vitor@php.rio> | 2021-09-17 12:01:48 +0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2021-09-17 12:02:47 +0300 |
commit | 7a17994b1af7e02e61aaacd751ba7252405bf8ef (patch) | |
tree | 7221bc2794d4f7f7b26619d108bb94bd43669eb4 /tests | |
parent | 049f724e9177d9804998a6146009f6e029551ba8 (diff) |
Change from willReturnCallback to willReturnMap
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/php/BackgroundJob/CheckHostedSignalingServerTest.php | 20 |
1 files changed, 8 insertions, 12 deletions
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( |