Skip to content

Commit

Permalink
Merge pull request #5 from alanbem/update
Browse files Browse the repository at this point in the history
update
  • Loading branch information
alanbem committed Mar 19, 2020
2 parents ba72670 + 495b5c1 commit 32ae312
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
dist: trusty

language: php

php:
- 5.5
- 5.6
- 7.0
- 7.1
- nightly
- 7.2
- 7.3

before_script:
- wget http://getcomposer.org/composer.phar
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
}
],
"require": {
"php": ">=5.5.0",
"php": ">=5.6.0",
"guzzlehttp/guzzle": "^5.0|^6.0",
"symfony/serializer": "^2.0|^3.0"
"symfony/serializer": "^2.0|^3.0|^4.0|^5.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0"
"phpunit/phpunit": "^5.0"
},
"autoload": {
"psr-0": {
Expand Down
18 changes: 9 additions & 9 deletions tests/Josser/Tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ class ClientTest extends JosserTestCase
public function testRequest($requestMethod, $requestParameters, $responseResult)
{
/* @var $transport \Josser\Client\Transport\TransportInterface */
$transport = $this->getMock('Josser\Client\Transport\TransportInterface');
$transport = $this->getMockBuilder(Client\Transport\TransportInterface::class)->getMockForAbstractClass();
/* @var $protocol \Josser\Protocol\Protocol */
$protocol = $this->getMock('Josser\Client\Protocol\Protocol');
$protocol = $this->getMockBuilder(Client\Protocol\Protocol::class)->getMockForAbstractClass();
/* @var $response \Josser\Client\Response\ResponseInterface */
$response = $this->getMock('Josser\Client\Response\ResponseInterface');
$response = $this->getMockBuilder(Client\Response\ResponseInterface::class)->getMockForAbstractClass();
$response->expects($this->any())
->method('getResult')
->will($this->returnValue($responseResult));

/* @var $client \Josser\Client */
$client = $this->getMock('Josser\Client', array('call'), array($transport, $protocol));
$client = $this->getMockBuilder(Client::class)->setConstructorArgs([$transport, $protocol])->setMethods(['call'])->getMock();
$client->expects($this->once())
->method('call')
->with(
Expand All @@ -64,17 +64,17 @@ public function testRequest($requestMethod, $requestParameters, $responseResult)
public function testNotify($requestMethod, $requestParameters, $responseResult)
{
/* @var $transport \Josser\Client\Transport\TransportInterface */
$transport = $this->getMock('Josser\Client\Transport\TransportInterface');
$transport = $this->getMockBuilder(Client\Transport\TransportInterface::class)->getMockForAbstractClass();
/* @var $protocol \Josser\Protocol\Protocol */
$protocol = $this->getMock('Josser\Client\Protocol\Protocol');
$protocol = $this->getMockBuilder(Client\Protocol\Protocol::class)->getMockForAbstractClass();
/* @var $response \Josser\Client\Response\ResponseInterface */
$response = $this->getMock('Josser\Client\Response\ResponseInterface');
$response = $this->getMockBuilder(Client\Response\ResponseInterface::class)->getMockForAbstractClass();
$response->expects($this->any())
->method('getResult')
->will($this->returnValue($responseResult));

/* @var $client \Josser\Client */
$client = $this->getMock('Josser\Client', array('call'), array($transport, $protocol));
$client = $this->getMockBuilder(Client::class)->setConstructorArgs([$transport, $protocol])->setMethods(['call'])->getMock();
$client->expects($this->once())
->method('call')
->with(
Expand Down Expand Up @@ -103,4 +103,4 @@ public function requestAndNotificationDataProvider()
array('divide', array(3, 2), 1.5),
);
}
}
}
8 changes: 4 additions & 4 deletions tests/Josser/Tests/Protocol/JsonRpc1Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ public function validRequestsDataProvider()
*/
public function invalidRequestsDataProvider()
{
$mock = $this->getMock('Josser\Client\Request\RequestInterface');
$mock->expects($this->atLeastOnce())
$mock = $this->getMockBuilder(RequestInterface::class)->getMockForAbstractClass();
$mock->expects($this->any())
->method('getMethod')
->will($this->returnValue('mocked.math.sum'));
$mock->expects($this->atLeastOnce())
$mock->expects($this->any())
->method('getId')
->will($this->returnValue(123324234));

Expand Down Expand Up @@ -364,4 +364,4 @@ public function requestsAndNotificationsDataProvider()
array(new Notification('system.exit', array()), true),
);
}
}
}
6 changes: 3 additions & 3 deletions tests/Josser/Tests/Protocol/JsonRpc2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@ public function validRequestsDataProvider()
*/
public function invalidRequestsDataProvider()
{
$mock = $this->getMock('Josser\Client\Request\RequestInterface');
$mock->expects($this->atLeastOnce())
$mock = $this->getMockBuilder(RequestInterface::class)->getMockForAbstractClass();
$mock->expects($this->any())
->method('getMethod')
->will($this->returnValue('mocked.math.sum'));
$mock->expects($this->atLeastOnce())
$mock->expects($this->any())
->method('getId')
->will($this->returnValue(123324234));

Expand Down

0 comments on commit 32ae312

Please sign in to comment.