mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 02:11:45 +01:00
Tests - Client - verify null returned as raw data by JsonRpcClient
This commit is contained in:
@@ -52,13 +52,14 @@ class ClientTest extends BaseTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $method Name of method to call
|
* @param string $method Name of method to call
|
||||||
* @param array $arguments Arguments of the 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 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
|
* @dataProvider provideMethod
|
||||||
*/
|
*/
|
||||||
public function testRun($method, $arguments, $debugMode)
|
public function testRun($method, $arguments, $debugMode, $expectedRawData)
|
||||||
{
|
{
|
||||||
$sessionManager = $this->createMock(SessionManager::class);
|
$sessionManager = $this->createMock(SessionManager::class);
|
||||||
$rpcClientManager = $this->createMock(JsonRpcClientManager::class);
|
$rpcClientManager = $this->createMock(JsonRpcClientManager::class);
|
||||||
@@ -66,7 +67,7 @@ class ClientTest extends BaseTestCase
|
|||||||
$rpcClientManager
|
$rpcClientManager
|
||||||
->expects(static::any())
|
->expects(static::any())
|
||||||
->method('runMethod')
|
->method('runMethod')
|
||||||
->willReturn([]);
|
->willReturn($expectedRawData);
|
||||||
|
|
||||||
$configuration = new ConnectionConfiguration(
|
$configuration = new ConnectionConfiguration(
|
||||||
$this->configuration->getBaseUrl(),
|
$this->configuration->getBaseUrl(),
|
||||||
@@ -127,18 +128,21 @@ class ClientTest extends BaseTestCase
|
|||||||
MethodType::GET_PARTICIPANT_PROPERTIES,
|
MethodType::GET_PARTICIPANT_PROPERTIES,
|
||||||
[],
|
[],
|
||||||
true,
|
true,
|
||||||
|
[],
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield[
|
||||||
MethodType::LIST_SURVEYS,
|
MethodType::LIST_SURVEYS,
|
||||||
[],
|
[],
|
||||||
false,
|
false,
|
||||||
|
[],
|
||||||
];
|
];
|
||||||
|
|
||||||
yield[
|
yield[
|
||||||
MethodType::LIST_PARTICIPANTS,
|
MethodType::LIST_PARTICIPANTS,
|
||||||
[],
|
[],
|
||||||
false,
|
false,
|
||||||
|
null,
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user