Support PHP 5.5.9+

This commit is contained in:
Krzysztof Niziol
2017-11-07 19:09:13 +01:00
parent a3f6adb128
commit a3e5c78dcd
13 changed files with 51 additions and 56 deletions

View File

@@ -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())

View File

@@ -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())