@@ -50,7 +50,7 @@ public static function setUpBeforeClass(): void
50
50
public function testLoadUnExistFile ()
51
51
{
52
52
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
53
- $ this ->expectExceptionMessageRegExp ('/The file ".+" does not exist./ ' );
53
+ $ this ->expectExceptionMessageMatches ('/The file ".+" does not exist./ ' );
54
54
$ loader = new YamlFileLoader (new ContainerBuilder (), new FileLocator (self ::$ fixturesPath .'/ini ' ));
55
55
$ r = new \ReflectionObject ($ loader );
56
56
$ m = $ r ->getMethod ('loadFile ' );
@@ -62,7 +62,7 @@ public function testLoadUnExistFile()
62
62
public function testLoadInvalidYamlFile ()
63
63
{
64
64
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
65
- $ this ->expectExceptionMessageRegExp ('/The file ".+" does not contain valid YAML./ ' );
65
+ $ this ->expectExceptionMessageMatches ('/The file ".+" does not contain valid YAML./ ' );
66
66
$ path = self ::$ fixturesPath .'/ini ' ;
67
67
$ loader = new YamlFileLoader (new ContainerBuilder (), new FileLocator ($ path ));
68
68
$ r = new \ReflectionObject ($ loader );
@@ -363,15 +363,15 @@ public function testLoadYamlOnlyWithKeys()
363
363
public function testTagWithEmptyNameThrowsException ()
364
364
{
365
365
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
366
- $ this ->expectExceptionMessageRegExp ('/The tag name for service ".+" in .+ must be a non-empty string/ ' );
366
+ $ this ->expectExceptionMessageMatches ('/The tag name for service ".+" in .+ must be a non-empty string/ ' );
367
367
$ loader = new YamlFileLoader (new ContainerBuilder (), new FileLocator (self ::$ fixturesPath .'/yaml ' ));
368
368
$ loader ->load ('tag_name_empty_string.yml ' );
369
369
}
370
370
371
371
public function testTagWithNonStringNameThrowsException ()
372
372
{
373
373
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
374
- $ this ->expectExceptionMessageRegExp ('/The tag name for service ".+" in .+ must be a non-empty string/ ' );
374
+ $ this ->expectExceptionMessageMatches ('/The tag name for service ".+" in .+ must be a non-empty string/ ' );
375
375
$ loader = new YamlFileLoader (new ContainerBuilder (), new FileLocator (self ::$ fixturesPath .'/yaml ' ));
376
376
$ loader ->load ('tag_name_no_string.yml ' );
377
377
}
@@ -472,7 +472,7 @@ public function testPrototypeWithNamespace()
472
472
public function testPrototypeWithNamespaceAndNoResource ()
473
473
{
474
474
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
475
- $ this ->expectExceptionMessageRegExp ('/A "resource" attribute must be set when the "namespace" attribute is set for service ".+" in .+/ ' );
475
+ $ this ->expectExceptionMessageMatches ('/A "resource" attribute must be set when the "namespace" attribute is set for service ".+" in .+/ ' );
476
476
$ container = new ContainerBuilder ();
477
477
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
478
478
$ loader ->load ('services_prototype_namespace_without_resource.yml ' );
@@ -600,7 +600,7 @@ public function testDecoratedServicesWithWrongOnInvalidSyntaxThrowsException()
600
600
public function testInvalidTagsWithDefaults ()
601
601
{
602
602
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
603
- $ this ->expectExceptionMessageRegExp ('/Parameter "tags" must be an array for service "Foo \\\Bar" in ".+services31_invalid_tags\.yml"\. Check your YAML syntax./ ' );
603
+ $ this ->expectExceptionMessageMatches ('/Parameter "tags" must be an array for service "Foo \\\Bar" in ".+services31_invalid_tags\.yml"\. Check your YAML syntax./ ' );
604
604
$ loader = new YamlFileLoader (new ContainerBuilder (), new FileLocator (self ::$ fixturesPath .'/yaml ' ));
605
605
$ loader ->load ('services31_invalid_tags.yml ' );
606
606
}
@@ -690,7 +690,7 @@ public function testAnonymousServicesInInstanceof()
690
690
public function testAnonymousServicesWithAliases ()
691
691
{
692
692
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
693
- $ this ->expectExceptionMessageRegExp ('/Creating an alias using the tag "!service" is not allowed in ".+anonymous_services_alias\.yml"\./ ' );
693
+ $ this ->expectExceptionMessageMatches ('/Creating an alias using the tag "!service" is not allowed in ".+anonymous_services_alias\.yml"\./ ' );
694
694
$ container = new ContainerBuilder ();
695
695
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
696
696
$ loader ->load ('anonymous_services_alias.yml ' );
@@ -699,7 +699,7 @@ public function testAnonymousServicesWithAliases()
699
699
public function testAnonymousServicesInParameters ()
700
700
{
701
701
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
702
- $ this ->expectExceptionMessageRegExp ('/Using an anonymous service in a parameter is not allowed in ".+anonymous_services_in_parameters\.yml"\./ ' );
702
+ $ this ->expectExceptionMessageMatches ('/Using an anonymous service in a parameter is not allowed in ".+anonymous_services_in_parameters\.yml"\./ ' );
703
703
$ container = new ContainerBuilder ();
704
704
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
705
705
$ loader ->load ('anonymous_services_in_parameters.yml ' );
@@ -718,7 +718,7 @@ public function testAutoConfigureInstanceof()
718
718
public function testEmptyDefaultsThrowsClearException ()
719
719
{
720
720
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
721
- $ this ->expectExceptionMessageRegExp ('/Service "_defaults" key must be an array, "NULL" given in ".+bad_empty_defaults\.yml"\./ ' );
721
+ $ this ->expectExceptionMessageMatches ('/Service "_defaults" key must be an array, "NULL" given in ".+bad_empty_defaults\.yml"\./ ' );
722
722
$ container = new ContainerBuilder ();
723
723
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
724
724
$ loader ->load ('bad_empty_defaults.yml ' );
@@ -727,7 +727,7 @@ public function testEmptyDefaultsThrowsClearException()
727
727
public function testEmptyInstanceofThrowsClearException ()
728
728
{
729
729
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
730
- $ this ->expectExceptionMessageRegExp ('/Service "_instanceof" key must be an array, "NULL" given in ".+bad_empty_instanceof\.yml"\./ ' );
730
+ $ this ->expectExceptionMessageMatches ('/Service "_instanceof" key must be an array, "NULL" given in ".+bad_empty_instanceof\.yml"\./ ' );
731
731
$ container = new ContainerBuilder ();
732
732
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
733
733
$ loader ->load ('bad_empty_instanceof.yml ' );
@@ -736,7 +736,7 @@ public function testEmptyInstanceofThrowsClearException()
736
736
public function testUnsupportedKeywordThrowsException ()
737
737
{
738
738
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
739
- $ this ->expectExceptionMessageRegExp ('/^The configuration key "private" is unsupported for definition "bar"/ ' );
739
+ $ this ->expectExceptionMessageMatches ('/^The configuration key "private" is unsupported for definition "bar"/ ' );
740
740
$ container = new ContainerBuilder ();
741
741
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
742
742
$ loader ->load ('bad_keyword.yml ' );
@@ -745,7 +745,7 @@ public function testUnsupportedKeywordThrowsException()
745
745
public function testUnsupportedKeywordInServiceAliasThrowsException ()
746
746
{
747
747
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
748
- $ this ->expectExceptionMessageRegExp ('/^The configuration key "calls" is unsupported for the service "bar" which is defined as an alias/ ' );
748
+ $ this ->expectExceptionMessageMatches ('/^The configuration key "calls" is unsupported for the service "bar" which is defined as an alias/ ' );
749
749
$ container = new ContainerBuilder ();
750
750
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
751
751
$ loader ->load ('bad_alias.yml ' );
0 commit comments