Skip to content

Commit 5c935de

Browse files
authored
test it against php7.4 (#15)
* test it against php7.4 * upgrade to phpunit 8 * make compatible with phpunit 8
1 parent ad02a32 commit 5c935de

11 files changed

+16
-14
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ matrix:
1616
env: SYMFONY_VERSION=^4.3
1717
- php: 7.2
1818
env: SYMFONY_VERSION=^5.0
19+
- php: 7.4
20+
env: SYMFONY_VERSION=^5.0
1921

2022
allow_failures:
2123
- php: nightly

Tests/Command/BaseCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ abstract class BaseCommandTest extends TestCase
1111
protected $helperSet;
1212
protected $command;
1313

14-
protected function setUp()
14+
protected function setUp(): void
1515
{
1616
$this->application = $this->getMockBuilder('Symfony\\Component\\Console\\Application')
1717
->disableOriginalConstructor()

Tests/Command/ConsumerCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class ConsumerCommandTest extends BaseCommandTest
99
{
10-
protected function setUp()
10+
protected function setUp(): void
1111
{
1212
parent::setUp();
1313
$this->definition->expects($this->any())

Tests/Command/DynamicConsumerCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class DynamicConsumerCommandTest extends BaseCommandTest
99
{
1010

11-
protected function setUp()
11+
protected function setUp(): void
1212
{
1313
parent::setUp();
1414
$this->definition->expects($this->any())

Tests/Command/MultipleConsumerCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class MultipleConsumerCommandTest extends BaseCommandTest
99
{
1010

11-
protected function setUp()
11+
protected function setUp(): void
1212
{
1313
parent::setUp();
1414
$this->definition->expects($this->any())

Tests/Command/PurgeCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class PurgeCommandTest extends BaseCommandTest
99
{
10-
protected function setUp()
10+
protected function setUp(): void
1111
{
1212
parent::setUp();
1313
$this->definition->expects($this->any())

Tests/DependencyInjection/OldSoundRabbitMqExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public function testConsumerWithQosOptions()
442442
}
443443
}
444444

445-
$this->assertInternalType('array', $setQosParameters);
445+
$this->assertIsArray($setQosParameters);
446446
$this->assertEquals(
447447
array(
448448
1024,

Tests/RabbitMq/AMQPConnectionFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function testSSLConnectionParameters()
247247
$context = $instance->constructParams[11];
248248
// unset to check whole array at once later
249249
$instance->constructParams[11] = null;
250-
$this->assertInternalType('resource', $context);
250+
$this->assertIsResource($context);
251251
$this->assertEquals('stream-context', get_resource_type($context));
252252
$options = stream_context_get_options($context);
253253
$this->assertEquals(array('ssl' => array('verify_peer' => false)), $options);

Tests/RabbitMq/BaseConsumerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class BaseConsumerTest extends TestCase
1010
/** @var BaseConsumer */
1111
protected $consumer;
1212

13-
protected function setUp()
13+
protected function setUp(): void
1414
{
15-
$amqpConnection = $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPConnection')
15+
$amqpConnection = $this->getMockBuilder('\PhpAmqpLib\Connection\AMQPConnection')
1616
->disableOriginalConstructor()
1717
->getMock();
1818

Tests/RabbitMq/MultipleConsumerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MultipleConsumerTest extends TestCase
3939
*
4040
* @return void
4141
*/
42-
public function setUp()
42+
public function setUp(): void
4343
{
4444
$this->amqpConnection = $this->prepareAMQPConnection();
4545
$this->amqpChannel = $this->prepareAMQPChannel();
@@ -246,14 +246,14 @@ private function prepareAMQPChannelExpectations($expectedMethod, $expectedRequeu
246246
{
247247
$this->amqpChannel->expects($this->any())
248248
->method('basic_reject')
249-
->will($this->returnCallback(function($delivery_tag, $requeue) use ($expectedMethod, $expectedRequeue) {
249+
->will($this->returnCallback(function ($delivery_tag, $requeue) use ($expectedMethod, $expectedRequeue) {
250250
Assert::assertSame($expectedMethod, 'basic_reject'); // Check if this function should be called.
251251
Assert::assertSame($requeue, $expectedRequeue); // Check if the message should be requeued.
252252
}));
253253

254254
$this->amqpChannel->expects($this->any())
255255
->method('basic_ack')
256-
->will($this->returnCallback(function($delivery_tag) use ($expectedMethod) {
256+
->will($this->returnCallback(function ($delivery_tag) use ($expectedMethod) {
257257
Assert::assertSame($expectedMethod, 'basic_ack'); // Check if this function should be called.
258258
}));
259259
}
@@ -266,7 +266,7 @@ private function prepareAMQPChannelExpectations($expectedMethod, $expectedRequeu
266266
*/
267267
private function prepareCallback($processFlag)
268268
{
269-
return function($msg) use (&$lastQueue, $processFlag) {
269+
return function ($msg) use (&$lastQueue, $processFlag) {
270270
return $processFlag;
271271
};
272272
}

0 commit comments

Comments
 (0)