diff --git a/.travis.yml b/.travis.yml index fdc45dd..d213dc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/composer.json b/composer.json index 8e72f1b..1aef8a6 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/tests/Josser/Tests/ClientTest.php b/tests/Josser/Tests/ClientTest.php index 322f582..cf1abd4 100644 --- a/tests/Josser/Tests/ClientTest.php +++ b/tests/Josser/Tests/ClientTest.php @@ -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( @@ -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( @@ -103,4 +103,4 @@ public function requestAndNotificationDataProvider() array('divide', array(3, 2), 1.5), ); } -} \ No newline at end of file +} diff --git a/tests/Josser/Tests/Protocol/JsonRpc1Test.php b/tests/Josser/Tests/Protocol/JsonRpc1Test.php index b968244..bc94dac 100644 --- a/tests/Josser/Tests/Protocol/JsonRpc1Test.php +++ b/tests/Josser/Tests/Protocol/JsonRpc1Test.php @@ -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)); @@ -364,4 +364,4 @@ public function requestsAndNotificationsDataProvider() array(new Notification('system.exit', array()), true), ); } -} \ No newline at end of file +} diff --git a/tests/Josser/Tests/Protocol/JsonRpc2Test.php b/tests/Josser/Tests/Protocol/JsonRpc2Test.php index bec3939..f424500 100644 --- a/tests/Josser/Tests/Protocol/JsonRpc2Test.php +++ b/tests/Josser/Tests/Protocol/JsonRpc2Test.php @@ -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));