Skip to content

Commit eac15a9

Browse files
author
Alejandro Perez Favieres
committed
bump phpunit to 8.5
1 parent 4cedf24 commit eac15a9

55 files changed

Lines changed: 108 additions & 95 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ composer.lock
1818

1919
# PHP CS Fixer
2020
.php_cs.cache
21+
/.phpunit.result.cache

Components/Queues/Drivers/AmqpQueueDriver.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,4 +307,10 @@ protected function validateConnection()
307307
{
308308
return $this->stream instanceof AbstractConnection;
309309
}
310+
311+
public function purge(string $queue): void
312+
{
313+
$this->declareChannel();
314+
$this->channel->queue_purge($queue);
315+
}
310316
}

Core/Processors/Routing/ContentRouter.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,12 @@ protected function onPostProcessEvent(ProcessEvent $event)
9191
$condition = $event->getProcessingContext()->get(self::CONDITION_MATCHED);
9292
$event->setEventDetails('Matched condition: '.$condition);
9393
}
94+
95+
/**
96+
* @return ConditionalClause[]
97+
*/
98+
public function clauses(): array
99+
{
100+
return $this->clauses;
101+
}
94102
}

Tests/BaseKernelTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BaseKernelTestCase extends KernelTestCase
1717
/** @var SmartesbHelper */
1818
protected $helper;
1919

20-
protected function setUp()
20+
protected function setUp(): void
2121
{
2222
$this->bootKernel();
2323
$this->getContainer()->set('doctrine', $this->createMock(RegistryInterface::class));

Tests/Functional/Consumers/AsyncQueueConsumerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function testConsume()
4444
$serializer = $consumer->getSerializer();
4545
$queueDriver = $this->getQueueDriver('amqp');
4646
$queueDriver->connect();
47+
$queueDriver->purge(self::QUEUE);
4748

4849
$message = $this->createMessage(new EntityX(333));
4950
$queueMessage = new QueueMessage();
@@ -72,7 +73,7 @@ public function testConsume()
7273
$consumer->consume($endpoint);
7374

7475
$output = $this->getActualOutput();
75-
$this->assertNotContains('A message was consumed', $output);
76+
$this->assertStringNotContainsString('A message was consumed', $output);
7677
}
7778

7879
/**

Tests/Functional/Consumers/QueueConsumerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function (Endpoint $endpoint) use ($queues) {
127127
\pcntl_alarm(0);
128128

129129
$output = $this->getActualOutput();
130-
$this->assertNotContains('A message was consumed', $output); // The consumer should not display message information if no logger
130+
$this->assertStringNotContainsString('A message was consumed', $output); // The consumer should not display message information if no logger
131131
}
132132

133133
/**
@@ -197,6 +197,6 @@ function (Endpoint $endpoint) use ($queues) {
197197
\pcntl_alarm(0);
198198

199199
$output = $this->getActualOutput();
200-
$this->assertNotContains('A message was consumed', $output); // The consumer should not display message information with NullLogger
200+
$this->assertStringNotContainsString('A message was consumed', $output); // The consumer should not display message information with NullLogger
201201
}
202202
}

Tests/Functional/Drivers/Queue/AbstractQueueDriverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ abstract class AbstractQueueDriverTest extends BaseTestCase
2929
*/
3030
protected $driver;
3131

32-
protected function setUp()
32+
protected function setUp(): void
3333
{
3434
parent::setUp();
3535
$this->driver = $this->createDriver();
3636
$this->driver->connect();
3737
$this->queueName = static::QUEUE_PREFIX.(new \ReflectionClass($this->driver))->getShortName().md5(random_bytes(10));
3838
}
3939

40-
protected function tearDown()
40+
protected function tearDown(): void
4141
{
4242
$this->driver->disconnect();
4343
$this->driver = null;

Tests/Functional/Handlers/DeferredEventsHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class DeferredEventsHandlerTest extends \PHPUnit\Framework\TestCase
2323
/** @var EventDispatcherInterface|\PHPUnit_Framework_MockObject_MockObject */
2424
public $eventDispatcherMock;
2525

26-
public function setUp()
26+
public function setUp(): void
2727
{
2828
$this->eventDispatcherMock = $this->createMock(EventDispatcherInterface::class);
2929
$this->handler = new DeferredEventsHandler();

Tests/Functional/Handlers/MessageHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MessageHandlerTest extends \PHPUnit\Framework\TestCase
4545
/** @var MessageFactoryInterface */
4646
public $factory;
4747

48-
protected function setUp()
48+
protected function setUp(): void
4949
{
5050
$this->eventDispatcherMock = $this->createMock(EventDispatcherInterface::class);
5151
$this->handler = new MessageHandler();

Tests/Functional/ProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract public function getInvalidMessages();
1717

1818
abstract public function getWorkingMessages();
1919

20-
public function setUp()
20+
public function setUp(): void
2121
{
2222
parent::setUp();
2323
$this->processor = $this->createProcessor();

0 commit comments

Comments
 (0)