diff --git a/tests/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php b/tests/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php index 9ada175bd00..0e5118c353a 100644 --- a/tests/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php +++ b/tests/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php @@ -452,7 +452,7 @@ public function testAddResourceClassDirectories() public function testResourcesToWatchWithUnsupportedMappingType() { $this->expectException(RuntimeException::class); - $this->expectExceptionMessageRegExp('/Unsupported mapping type in ".+", supported types are XML & YAML\\./'); + $this->expectExceptionMessageMatches('/Unsupported mapping type in ".+", supported types are XML & YAML\\./'); $config = self::DEFAULT_CONFIG; $config['api_platform']['mapping']['paths'] = [__FILE__]; diff --git a/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php b/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php index 57510a68ca1..ade453c41a9 100644 --- a/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php +++ b/tests/Bridge/Symfony/Bundle/DependencyInjection/ConfigurationTest.php @@ -261,7 +261,7 @@ public function invalidHttpStatusCodeProvider() public function testExceptionToStatusConfigWithInvalidHttpStatusCode($invalidHttpStatusCode) { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessageRegExp('/The HTTP status code ".+" is not valid\\./'); + $this->expectExceptionMessageMatches('/The HTTP status code ".+" is not valid\\./'); $this->processor->processConfiguration($this->configuration, [ 'api_platform' => [ @@ -290,7 +290,7 @@ public function invalidHttpStatusCodeValueProvider() public function testExceptionToStatusConfigWithInvalidHttpStatusCodeValue($invalidHttpStatusCodeValue) { $this->expectException(InvalidTypeException::class); - $this->expectExceptionMessageRegExp('/Invalid type for path "api_platform\\.exception_to_status\\.Exception". Expected "?int"?, but got "?.+"?\./'); + $this->expectExceptionMessageMatches('/Invalid type for path "api_platform\\.exception_to_status\\.Exception". Expected "?int"?, but got "?.+"?\./'); $this->processor->processConfiguration($this->configuration, [ 'api_platform' => [ @@ -369,7 +369,7 @@ public function testSwaggerVersionConfig() $this->assertSame([2], $config['swagger']['versions']); $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessageRegExp('/Only the versions .+ are supported. Got .+./'); + $this->expectExceptionMessageMatches('/Only the versions .+ are supported. Got .+./'); $this->processor->processConfiguration($this->configuration, [ 'api_platform' => [ diff --git a/tests/GraphQl/Type/Definition/IterableTypeTest.php b/tests/GraphQl/Type/Definition/IterableTypeTest.php index 1bfb4c30269..8f5a86c9f3a 100644 --- a/tests/GraphQl/Type/Definition/IterableTypeTest.php +++ b/tests/GraphQl/Type/Definition/IterableTypeTest.php @@ -43,7 +43,7 @@ public function testSerialize() $iterableType = new IterableType(); $this->expectException(Error::class); - $this->expectExceptionMessageRegExp('/`Iterable` cannot represent non iterable value: .+/'); + $this->expectExceptionMessageMatches('/`Iterable` cannot represent non iterable value: .+/'); $iterableType->serialize('foo'); @@ -55,7 +55,7 @@ public function testParseValue() $iterableType = new IterableType(); $this->expectException(Error::class); - $this->expectExceptionMessageRegExp('/`Iterable` cannot represent non iterable value: .+/'); + $this->expectExceptionMessageMatches('/`Iterable` cannot represent non iterable value: .+/'); $iterableType->parseValue('foo'); diff --git a/tests/Metadata/Extractor/YamlExtractorTestCase.php b/tests/Metadata/Extractor/YamlExtractorTestCase.php index ddfaf6b1a63..d8ee080789f 100644 --- a/tests/Metadata/Extractor/YamlExtractorTestCase.php +++ b/tests/Metadata/Extractor/YamlExtractorTestCase.php @@ -34,7 +34,7 @@ public function testInvalidProperty() public function testParseException() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/Unable to parse in ".+\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/parse_exception.yml"/'); + $this->expectExceptionMessageMatches('/Unable to parse in ".+\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/parse_exception.yml"/'); (new YamlExtractor([__DIR__.'/../../Fixtures/FileConfigurations/parse_exception.yml']))->getResources(); } diff --git a/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php b/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php index 82cd34f8f33..266de4b00fc 100644 --- a/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php +++ b/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php @@ -87,7 +87,7 @@ public function testCreateWithNonexistentPropertyXml() public function testCreateWithInvalidXml() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('#.+Element \'\\{https://api-platform.com/schema/metadata\\}foo\': This element is not expected\\..+#'); + $this->expectExceptionMessageMatches('#.+Element \'\\{https://api-platform.com/schema/metadata\\}foo\': This element is not expected\\..+#'); $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/propertyinvalid.xml'; @@ -203,7 +203,7 @@ public function testCreateWithNonexistentPropertyYaml() public function testCreateWithMalformedResourcesSettingYaml() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/"resources" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/resourcesinvalid\\.yml"\\./'); + $this->expectExceptionMessageMatches('/"resources" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/resourcesinvalid\\.yml"\\./'); $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/resourcesinvalid.yml'; @@ -213,7 +213,7 @@ public function testCreateWithMalformedResourcesSettingYaml() public function testCreateWithMalformedPropertiesSettingYaml() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/"properties" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/propertiesinvalid\\.yml"\\./'); + $this->expectExceptionMessageMatches('/"properties" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/propertiesinvalid\\.yml"\\./'); $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/propertiesinvalid.yml'; @@ -223,7 +223,7 @@ public function testCreateWithMalformedPropertiesSettingYaml() public function testCreateWithMalformedPropertySettingYaml() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/"foo" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/propertyinvalid\\.yml"\\./'); + $this->expectExceptionMessageMatches('/"foo" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/propertyinvalid\\.yml"\\./'); $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/propertyinvalid.yml'; diff --git a/tests/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactoryTest.php b/tests/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactoryTest.php index 95e142dea96..8768ece4e70 100644 --- a/tests/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactoryTest.php +++ b/tests/Metadata/Property/Factory/ExtractorPropertyNameCollectionFactoryTest.php @@ -67,7 +67,7 @@ public function testCreateWithNonexistentResourceXml() public function testCreateWithInvalidXml() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('#.+Element \'\\{https://api-platform.com/schema/metadata\\}foo\': This element is not expected\\..+#'); + $this->expectExceptionMessageMatches('#.+Element \'\\{https://api-platform.com/schema/metadata\\}foo\': This element is not expected\\..+#'); $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/propertyinvalid.xml'; @@ -113,7 +113,7 @@ public function testCreateWithNonexistentResourceYaml() public function testCreateWithMalformedResourcesSettingYaml() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/"resources" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/resourcesinvalid\\.yml"\\./'); + $this->expectExceptionMessageMatches('/"resources" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/resourcesinvalid\\.yml"\\./'); $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/resourcesinvalid.yml'; @@ -123,7 +123,7 @@ public function testCreateWithMalformedResourcesSettingYaml() public function testCreateWithMalformedPropertiesSettingYaml() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/"properties" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/propertiesinvalid\\.yml"\\./'); + $this->expectExceptionMessageMatches('/"properties" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/propertiesinvalid\\.yml"\\./'); $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/propertiesinvalid.yml'; @@ -133,7 +133,7 @@ public function testCreateWithMalformedPropertiesSettingYaml() public function testCreateWithMalformedPropertySettingYaml() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/"foo" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/propertyinvalid\\.yml"\\./'); + $this->expectExceptionMessageMatches('/"foo" setting is expected to be null or an array, string given in ".+\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/Fixtures\\/FileConfigurations\\/propertyinvalid\\.yml"\\./'); $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/propertyinvalid.yml'; diff --git a/tests/Metadata/Resource/Factory/ExtractorResourceMetadataFactoryTest.php b/tests/Metadata/Resource/Factory/ExtractorResourceMetadataFactoryTest.php index 28aea8d4b52..aa695657a23 100644 --- a/tests/Metadata/Resource/Factory/ExtractorResourceMetadataFactoryTest.php +++ b/tests/Metadata/Resource/Factory/ExtractorResourceMetadataFactoryTest.php @@ -260,7 +260,7 @@ public function testCreateWithMalformedYaml() public function testCreateWithBadDeclaration() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessageRegExp('/"ApiPlatform\\\\Core\\\\Tests\\\\Fixtures\\\\TestBundle\\\\Entity\\\\Dummy" setting is expected to be null or an array, string given in ".+\\/Fixtures\\/FileConfigurations\\/bad_declaration\\.yml"\\./'); + $this->expectExceptionMessageMatches('/"ApiPlatform\\\\Core\\\\Tests\\\\Fixtures\\\\TestBundle\\\\Entity\\\\Dummy" setting is expected to be null or an array, string given in ".+\\/Fixtures\\/FileConfigurations\\/bad_declaration\\.yml"\\./'); $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/bad_declaration.yml';