@@ -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 );
@@ -384,15 +384,15 @@ public function testLoadYamlOnlyWithKeys()
384
384
public function testTagWithEmptyNameThrowsException ()
385
385
{
386
386
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
387
- $ this ->expectExceptionMessageRegExp ('/The tag name for service ".+" in .+ must be a non-empty string/ ' );
387
+ $ this ->expectExceptionMessageMatches ('/The tag name for service ".+" in .+ must be a non-empty string/ ' );
388
388
$ loader = new YamlFileLoader (new ContainerBuilder (), new FileLocator (self ::$ fixturesPath .'/yaml ' ));
389
389
$ loader ->load ('tag_name_empty_string.yml ' );
390
390
}
391
391
392
392
public function testTagWithNonStringNameThrowsException ()
393
393
{
394
394
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
395
- $ this ->expectExceptionMessageRegExp ('/The tag name for service ".+" in .+ must be a non-empty string/ ' );
395
+ $ this ->expectExceptionMessageMatches ('/The tag name for service ".+" in .+ must be a non-empty string/ ' );
396
396
$ loader = new YamlFileLoader (new ContainerBuilder (), new FileLocator (self ::$ fixturesPath .'/yaml ' ));
397
397
$ loader ->load ('tag_name_no_string.yml ' );
398
398
}
@@ -493,7 +493,7 @@ public function testPrototypeWithNamespace()
493
493
public function testPrototypeWithNamespaceAndNoResource ()
494
494
{
495
495
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
496
- $ this ->expectExceptionMessageRegExp ('/A "resource" attribute must be set when the "namespace" attribute is set for service ".+" in .+/ ' );
496
+ $ this ->expectExceptionMessageMatches ('/A "resource" attribute must be set when the "namespace" attribute is set for service ".+" in .+/ ' );
497
497
$ container = new ContainerBuilder ();
498
498
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
499
499
$ loader ->load ('services_prototype_namespace_without_resource.yml ' );
@@ -621,7 +621,7 @@ public function testDecoratedServicesWithWrongOnInvalidSyntaxThrowsException()
621
621
public function testInvalidTagsWithDefaults ()
622
622
{
623
623
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
624
- $ this ->expectExceptionMessageRegExp ('/Parameter "tags" must be an array for service "Foo \\\Bar" in ".+services31_invalid_tags\.yml"\. Check your YAML syntax./ ' );
624
+ $ this ->expectExceptionMessageMatches ('/Parameter "tags" must be an array for service "Foo \\\Bar" in ".+services31_invalid_tags\.yml"\. Check your YAML syntax./ ' );
625
625
$ loader = new YamlFileLoader (new ContainerBuilder (), new FileLocator (self ::$ fixturesPath .'/yaml ' ));
626
626
$ loader ->load ('services31_invalid_tags.yml ' );
627
627
}
@@ -711,7 +711,7 @@ public function testAnonymousServicesInInstanceof()
711
711
public function testAnonymousServicesWithAliases ()
712
712
{
713
713
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
714
- $ this ->expectExceptionMessageRegExp ('/Creating an alias using the tag "!service" is not allowed in ".+anonymous_services_alias\.yml"\./ ' );
714
+ $ this ->expectExceptionMessageMatches ('/Creating an alias using the tag "!service" is not allowed in ".+anonymous_services_alias\.yml"\./ ' );
715
715
$ container = new ContainerBuilder ();
716
716
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
717
717
$ loader ->load ('anonymous_services_alias.yml ' );
@@ -720,7 +720,7 @@ public function testAnonymousServicesWithAliases()
720
720
public function testAnonymousServicesInParameters ()
721
721
{
722
722
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
723
- $ this ->expectExceptionMessageRegExp ('/Using an anonymous service in a parameter is not allowed in ".+anonymous_services_in_parameters\.yml"\./ ' );
723
+ $ this ->expectExceptionMessageMatches ('/Using an anonymous service in a parameter is not allowed in ".+anonymous_services_in_parameters\.yml"\./ ' );
724
724
$ container = new ContainerBuilder ();
725
725
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
726
726
$ loader ->load ('anonymous_services_in_parameters.yml ' );
@@ -739,7 +739,7 @@ public function testAutoConfigureInstanceof()
739
739
public function testEmptyDefaultsThrowsClearException ()
740
740
{
741
741
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
742
- $ this ->expectExceptionMessageRegExp ('/Service "_defaults" key must be an array, "NULL" given in ".+bad_empty_defaults\.yml"\./ ' );
742
+ $ this ->expectExceptionMessageMatches ('/Service "_defaults" key must be an array, "NULL" given in ".+bad_empty_defaults\.yml"\./ ' );
743
743
$ container = new ContainerBuilder ();
744
744
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
745
745
$ loader ->load ('bad_empty_defaults.yml ' );
@@ -748,7 +748,7 @@ public function testEmptyDefaultsThrowsClearException()
748
748
public function testEmptyInstanceofThrowsClearException ()
749
749
{
750
750
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
751
- $ this ->expectExceptionMessageRegExp ('/Service "_instanceof" key must be an array, "NULL" given in ".+bad_empty_instanceof\.yml"\./ ' );
751
+ $ this ->expectExceptionMessageMatches ('/Service "_instanceof" key must be an array, "NULL" given in ".+bad_empty_instanceof\.yml"\./ ' );
752
752
$ container = new ContainerBuilder ();
753
753
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
754
754
$ loader ->load ('bad_empty_instanceof.yml ' );
@@ -757,7 +757,7 @@ public function testEmptyInstanceofThrowsClearException()
757
757
public function testUnsupportedKeywordThrowsException ()
758
758
{
759
759
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
760
- $ this ->expectExceptionMessageRegExp ('/^The configuration key "private" is unsupported for definition "bar"/ ' );
760
+ $ this ->expectExceptionMessageMatches ('/^The configuration key "private" is unsupported for definition "bar"/ ' );
761
761
$ container = new ContainerBuilder ();
762
762
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
763
763
$ loader ->load ('bad_keyword.yml ' );
@@ -766,7 +766,7 @@ public function testUnsupportedKeywordThrowsException()
766
766
public function testUnsupportedKeywordInServiceAliasThrowsException ()
767
767
{
768
768
$ this ->expectException ('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException ' );
769
- $ this ->expectExceptionMessageRegExp ('/^The configuration key "calls" is unsupported for the service "bar" which is defined as an alias/ ' );
769
+ $ this ->expectExceptionMessageMatches ('/^The configuration key "calls" is unsupported for the service "bar" which is defined as an alias/ ' );
770
770
$ container = new ContainerBuilder ();
771
771
$ loader = new YamlFileLoader ($ container , new FileLocator (self ::$ fixturesPath .'/yaml ' ));
772
772
$ loader ->load ('bad_alias.yml ' );
0 commit comments