Skip to content

Commit 32ae312

Browse files
authored
Merge pull request #5 from alanbem/update
update
2 parents ba72670 + 495b5c1 commit 32ae312

File tree

5 files changed

+23
-21
lines changed

5 files changed

+23
-21
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
dist: trusty
2+
13
language: php
24

35
php:
4-
- 5.5
56
- 5.6
67
- 7.0
78
- 7.1
8-
- nightly
9+
- 7.2
10+
- 7.3
911

1012
before_script:
1113
- wget http://getcomposer.org/composer.phar

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=5.5.0",
15+
"php": ">=5.6.0",
1616
"guzzlehttp/guzzle": "^5.0|^6.0",
17-
"symfony/serializer": "^2.0|^3.0"
17+
"symfony/serializer": "^2.0|^3.0|^4.0|^5.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^4.0"
20+
"phpunit/phpunit": "^5.0"
2121
},
2222
"autoload": {
2323
"psr-0": {

tests/Josser/Tests/ClientTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ class ClientTest extends JosserTestCase
2929
public function testRequest($requestMethod, $requestParameters, $responseResult)
3030
{
3131
/* @var $transport \Josser\Client\Transport\TransportInterface */
32-
$transport = $this->getMock('Josser\Client\Transport\TransportInterface');
32+
$transport = $this->getMockBuilder(Client\Transport\TransportInterface::class)->getMockForAbstractClass();
3333
/* @var $protocol \Josser\Protocol\Protocol */
34-
$protocol = $this->getMock('Josser\Client\Protocol\Protocol');
34+
$protocol = $this->getMockBuilder(Client\Protocol\Protocol::class)->getMockForAbstractClass();
3535
/* @var $response \Josser\Client\Response\ResponseInterface */
36-
$response = $this->getMock('Josser\Client\Response\ResponseInterface');
36+
$response = $this->getMockBuilder(Client\Response\ResponseInterface::class)->getMockForAbstractClass();
3737
$response->expects($this->any())
3838
->method('getResult')
3939
->will($this->returnValue($responseResult));
4040

4141
/* @var $client \Josser\Client */
42-
$client = $this->getMock('Josser\Client', array('call'), array($transport, $protocol));
42+
$client = $this->getMockBuilder(Client::class)->setConstructorArgs([$transport, $protocol])->setMethods(['call'])->getMock();
4343
$client->expects($this->once())
4444
->method('call')
4545
->with(
@@ -64,17 +64,17 @@ public function testRequest($requestMethod, $requestParameters, $responseResult)
6464
public function testNotify($requestMethod, $requestParameters, $responseResult)
6565
{
6666
/* @var $transport \Josser\Client\Transport\TransportInterface */
67-
$transport = $this->getMock('Josser\Client\Transport\TransportInterface');
67+
$transport = $this->getMockBuilder(Client\Transport\TransportInterface::class)->getMockForAbstractClass();
6868
/* @var $protocol \Josser\Protocol\Protocol */
69-
$protocol = $this->getMock('Josser\Client\Protocol\Protocol');
69+
$protocol = $this->getMockBuilder(Client\Protocol\Protocol::class)->getMockForAbstractClass();
7070
/* @var $response \Josser\Client\Response\ResponseInterface */
71-
$response = $this->getMock('Josser\Client\Response\ResponseInterface');
71+
$response = $this->getMockBuilder(Client\Response\ResponseInterface::class)->getMockForAbstractClass();
7272
$response->expects($this->any())
7373
->method('getResult')
7474
->will($this->returnValue($responseResult));
7575

7676
/* @var $client \Josser\Client */
77-
$client = $this->getMock('Josser\Client', array('call'), array($transport, $protocol));
77+
$client = $this->getMockBuilder(Client::class)->setConstructorArgs([$transport, $protocol])->setMethods(['call'])->getMock();
7878
$client->expects($this->once())
7979
->method('call')
8080
->with(
@@ -103,4 +103,4 @@ public function requestAndNotificationDataProvider()
103103
array('divide', array(3, 2), 1.5),
104104
);
105105
}
106-
}
106+
}

tests/Josser/Tests/Protocol/JsonRpc1Test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ public function validRequestsDataProvider()
290290
*/
291291
public function invalidRequestsDataProvider()
292292
{
293-
$mock = $this->getMock('Josser\Client\Request\RequestInterface');
294-
$mock->expects($this->atLeastOnce())
293+
$mock = $this->getMockBuilder(RequestInterface::class)->getMockForAbstractClass();
294+
$mock->expects($this->any())
295295
->method('getMethod')
296296
->will($this->returnValue('mocked.math.sum'));
297-
$mock->expects($this->atLeastOnce())
297+
$mock->expects($this->any())
298298
->method('getId')
299299
->will($this->returnValue(123324234));
300300

@@ -364,4 +364,4 @@ public function requestsAndNotificationsDataProvider()
364364
array(new Notification('system.exit', array()), true),
365365
);
366366
}
367-
}
367+
}

tests/Josser/Tests/Protocol/JsonRpc2Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,11 @@ public function validRequestsDataProvider()
311311
*/
312312
public function invalidRequestsDataProvider()
313313
{
314-
$mock = $this->getMock('Josser\Client\Request\RequestInterface');
315-
$mock->expects($this->atLeastOnce())
314+
$mock = $this->getMockBuilder(RequestInterface::class)->getMockForAbstractClass();
315+
$mock->expects($this->any())
316316
->method('getMethod')
317317
->will($this->returnValue('mocked.math.sum'));
318-
$mock->expects($this->atLeastOnce())
318+
$mock->expects($this->any())
319319
->method('getId')
320320
->will($this->returnValue(123324234));
321321

0 commit comments

Comments
 (0)