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