Skip to content

Commit 928f0e8

Browse files
committed
Fix exception message variations between versions
1 parent b23e733 commit 928f0e8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pkg/enqueue-bundle/Tests/Unit/DependencyInjection/ConfigurationTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ public function testThrowIfClientDriverOptionsIsNotArray()
113113
$processor = new Processor();
114114

115115
$this->expectException(InvalidTypeException::class);
116-
$this->expectExceptionMessage('Invalid type for path "enqueue.default.client.driver_options". Expected array, but got string');
116+
// Exception messages vary slightly between versions
117+
$this->expectExceptionMessageMatches(
118+
'/Invalid type for path "enqueue\.default\.client\.driver_options"\. Expected "?array"?, but got "?string"?/'
119+
);
120+
117121
$processor->processConfiguration($configuration, [[
118122
'default' => [
119123
'transport' => 'null:',

pkg/enqueue/Tests/Symfony/ContainerProcessorRegistryTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ public function testThrowErrorIfServiceDoesNotImplementProcessorReturnType()
6969
$registry = new ContainerProcessorRegistry($containerMock);
7070

7171
$this->expectException(\TypeError::class);
72-
$this->expectExceptionMessage('Return value of Enqueue\Symfony\ContainerProcessorRegistry::get() must implement interface Interop\Queue\Processor, instance of stdClass returned');
72+
// Exception messages vary slightly between versions
73+
$this->expectExceptionMessageMatches(
74+
'/Return value of Enqueue\\Symfony\\ContainerProcessorRegistry::get\(\) .+ Interop\\Queue\\Processor, .?stdClass returned/'
75+
);
76+
7377
$registry->get('processor-name');
7478
}
7579

0 commit comments

Comments
 (0)