mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 10:11:49 +01:00
Support PHP 5.5.9+
This commit is contained in:
@@ -40,7 +40,7 @@ class JsonRpcClientManagerTest extends BaseTestCase
|
||||
|
||||
public function testRunMethodWithEmptyArrayReturned()
|
||||
{
|
||||
$rpcClient = $this->createMock(RpcClient::class);
|
||||
$rpcClient = $this->getMock(RpcClient::class);
|
||||
|
||||
$manager = $this
|
||||
->getMockBuilder(JsonRpcClientManager::class)
|
||||
@@ -68,8 +68,8 @@ class JsonRpcClientManagerTest extends BaseTestCase
|
||||
|
||||
public function testRunMethodWithRawDataReturned()
|
||||
{
|
||||
$rpcClient = $this->createMock(RpcClient::class);
|
||||
$manager = $this->createPartialMock(JsonRpcClientManager::class, ['getRpcClient']);
|
||||
$rpcClient = $this->getMock(RpcClient::class);
|
||||
$manager = $this->getMock(JsonRpcClientManager::class, ['getRpcClient'], [], '', false);
|
||||
|
||||
$rpcClient
|
||||
->expects(static::once())
|
||||
@@ -87,10 +87,10 @@ class JsonRpcClientManagerTest extends BaseTestCase
|
||||
|
||||
public function testRunMethodWithException()
|
||||
{
|
||||
$this->expectException(InvalidResultOfMethodRunException::class);
|
||||
$this->setExpectedException(InvalidResultOfMethodRunException::class);
|
||||
|
||||
$manager = $this->createPartialMock(JsonRpcClientManager::class, ['getRpcClient']);
|
||||
$rpcClient = $this->createMock(RpcClient::class);
|
||||
$manager = $this->getMock(JsonRpcClientManager::class, ['getRpcClient'], [], '', false);
|
||||
$rpcClient = $this->getMock(RpcClient::class);
|
||||
|
||||
$rpcClient
|
||||
->expects(self::once())
|
||||
|
||||
@@ -29,10 +29,9 @@ class SessionManagerTest extends BaseTestCase
|
||||
|
||||
public function testGetSessionKeyWhenFailedWithoutReason()
|
||||
{
|
||||
$this->expectException(CreateSessionKeyFailedException::class);
|
||||
$this->expectExceptionMessage('Create of the session key has failed');
|
||||
$this->setExpectedException(CreateSessionKeyFailedException::class, 'Create of the session key has failed');
|
||||
|
||||
$clientManager = $this->createMock(JsonRpcClientManager::class);
|
||||
$clientManager = $this->getMock(JsonRpcClientManager::class, [], [], '', false);
|
||||
|
||||
$clientManager
|
||||
->expects(static::any())
|
||||
@@ -46,10 +45,10 @@ class SessionManagerTest extends BaseTestCase
|
||||
{
|
||||
$reason = 'Invalid credentials';
|
||||
|
||||
$this->expectException(CreateSessionKeyFailedException::class);
|
||||
$this->expectExceptionMessage(sprintf('Create of the session key has failed. Reason: \'%s\'.', $reason));
|
||||
$message = sprintf('Create of the session key has failed. Reason: \'%s\'.', $reason);
|
||||
$this->setExpectedException(CreateSessionKeyFailedException::class, $message);
|
||||
|
||||
$clientManager = $this->createMock(JsonRpcClientManager::class);
|
||||
$clientManager = $this->getMock(JsonRpcClientManager::class, [], [], '', false);
|
||||
|
||||
$clientManager
|
||||
->expects(static::any())
|
||||
@@ -63,7 +62,7 @@ class SessionManagerTest extends BaseTestCase
|
||||
|
||||
public function testGetSessionKey()
|
||||
{
|
||||
$clientManager = $this->createMock(JsonRpcClientManager::class);
|
||||
$clientManager = $this->getMock(JsonRpcClientManager::class, [], [], '', false);
|
||||
|
||||
$clientManager
|
||||
->expects(static::any())
|
||||
@@ -76,7 +75,7 @@ class SessionManagerTest extends BaseTestCase
|
||||
|
||||
public function testReleaseSessionKey()
|
||||
{
|
||||
$clientManager = $this->createMock(JsonRpcClientManager::class);
|
||||
$clientManager = $this->getMock(JsonRpcClientManager::class, [], [], '', false);
|
||||
|
||||
$clientManager
|
||||
->expects(static::any())
|
||||
|
||||
Reference in New Issue
Block a user