mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 02:11:45 +01:00
Fix bug while releasing session key:
Uncaught exception 'Meritoo\LimeSurvey\ApiClient\Exception\UnknownMethodException' with message 'The 'get_session_key' type of name of method used while talking to the LimeSurvey's API is unknown
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"description": "Client of LimeSurvey API",
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.3",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Meritoo",
|
||||
|
||||
@@ -77,7 +77,8 @@ class Client
|
||||
public function run($method, $arguments = [])
|
||||
{
|
||||
/*
|
||||
* Let's validate method
|
||||
* Let's validate method.
|
||||
* It's called in the JsonRpcClientManager::runMethod() too, but I want to verify it before getting session key.
|
||||
*/
|
||||
$method = MethodType::getValidatedMethod($method);
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class MethodType extends BaseType
|
||||
*/
|
||||
public static function getValidatedMethod($method)
|
||||
{
|
||||
if ((new static())->isCorrectType($method)) {
|
||||
if ((new static())->isCorrectType($method) || (new SystemMethodType())->isCorrectType($method)) {
|
||||
return $method;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ use Generator;
|
||||
use Meritoo\Common\Test\Base\BaseTypeTestCase;
|
||||
use Meritoo\LimeSurvey\ApiClient\Exception\UnknownMethodException;
|
||||
use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
|
||||
use Meritoo\LimeSurvey\ApiClient\Type\SystemMethodType;
|
||||
|
||||
/**
|
||||
* Test case of the type of method used while talking with LimeSurvey's API
|
||||
@@ -88,6 +89,14 @@ class MethodTypeTest extends BaseTypeTestCase
|
||||
yield[
|
||||
MethodType::LIST_SURVEYS,
|
||||
];
|
||||
|
||||
yield[
|
||||
SystemMethodType::GET_SESSION_KEY,
|
||||
];
|
||||
|
||||
yield[
|
||||
SystemMethodType::RELEASE_SESSION_KEY,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user