From f8a675d0fb24d39ad21a8dfb4ee088262647bc96 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Thu, 28 Sep 2017 20:34:33 +0200 Subject: [PATCH] Tests - Client - verify null returned as raw data by JsonRpcClient --- .../Test/ApiClient/Client/ClientTest.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/Meritoo/LimeSurvey/Test/ApiClient/Client/ClientTest.php b/tests/Meritoo/LimeSurvey/Test/ApiClient/Client/ClientTest.php index 577d579..fb5fa03 100644 --- a/tests/Meritoo/LimeSurvey/Test/ApiClient/Client/ClientTest.php +++ b/tests/Meritoo/LimeSurvey/Test/ApiClient/Client/ClientTest.php @@ -52,13 +52,14 @@ class ClientTest extends BaseTestCase } /** - * @param string $method Name of method to call - * @param array $arguments Arguments of the method to call - * @param bool $debugMode If is set to true, the "debug" mode is turned on. Otherwise - turned off. + * @param string $method Name of method to call + * @param array $arguments Arguments of the method to call + * @param bool $debugMode If is set to true, the "debug" mode is turned on. Otherwise - turned off. + * @param mixed $expectedRawData Expected raw data returned by JsonRpcClient * * @dataProvider provideMethod */ - public function testRun($method, $arguments, $debugMode) + public function testRun($method, $arguments, $debugMode, $expectedRawData) { $sessionManager = $this->createMock(SessionManager::class); $rpcClientManager = $this->createMock(JsonRpcClientManager::class); @@ -66,7 +67,7 @@ class ClientTest extends BaseTestCase $rpcClientManager ->expects(static::any()) ->method('runMethod') - ->willReturn([]); + ->willReturn($expectedRawData); $configuration = new ConnectionConfiguration( $this->configuration->getBaseUrl(), @@ -127,18 +128,21 @@ class ClientTest extends BaseTestCase MethodType::GET_PARTICIPANT_PROPERTIES, [], true, + [], ]; yield[ MethodType::LIST_SURVEYS, [], false, + [], ]; yield[ MethodType::LIST_PARTICIPANTS, [], false, + null, ]; /*