@@ -137,7 +137,7 @@ public function testPropertyAccessCacheWithDebug()
137
137
138
138
public function testCsrfProtectionNeedsSessionToBeEnabled ()
139
139
{
140
- $ this ->expectException (' LogicException ' );
140
+ $ this ->expectException (\ LogicException::class );
141
141
$ this ->expectExceptionMessage ('CSRF protection needs sessions to be enabled. ' );
142
142
$ this ->createContainerFromFile ('csrf_needs_session ' );
143
143
}
@@ -317,21 +317,21 @@ public function testWorkflows()
317
317
318
318
public function testWorkflowAreValidated ()
319
319
{
320
- $ this ->expectException (' Symfony\Component\Workflow\Exception\InvalidDefinitionException ' );
320
+ $ this ->expectException (\ Symfony \Component \Workflow \Exception \InvalidDefinitionException::class );
321
321
$ this ->expectExceptionMessage ('A transition from a place/state must have an unique name. Multiple transitions named "go" from place/state "first" were found on StateMachine "my_workflow". ' );
322
322
$ this ->createContainerFromFile ('workflow_not_valid ' );
323
323
}
324
324
325
325
public function testWorkflowCannotHaveBothSupportsAndSupportStrategy ()
326
326
{
327
- $ this ->expectException (' Symfony\Component\Config\Definition\Exception\InvalidConfigurationException ' );
327
+ $ this ->expectException (\ Symfony \Component \Config \Definition \Exception \InvalidConfigurationException::class );
328
328
$ this ->expectExceptionMessage ('"supports" and "support_strategy" cannot be used together. ' );
329
329
$ this ->createContainerFromFile ('workflow_with_support_and_support_strategy ' );
330
330
}
331
331
332
332
public function testWorkflowShouldHaveOneOfSupportsAndSupportStrategy ()
333
333
{
334
- $ this ->expectException (' Symfony\Component\Config\Definition\Exception\InvalidConfigurationException ' );
334
+ $ this ->expectException (\ Symfony \Component \Config \Definition \Exception \InvalidConfigurationException::class );
335
335
$ this ->expectExceptionMessage ('"supports" or "support_strategy" should be configured. ' );
336
336
$ this ->createContainerFromFile ('workflow_without_support_and_support_strategy ' );
337
337
}
@@ -513,7 +513,7 @@ public function testRouter()
513
513
514
514
public function testRouterRequiresResourceOption ()
515
515
{
516
- $ this ->expectException (' Symfony\Component\Config\Definition\Exception\InvalidConfigurationException ' );
516
+ $ this ->expectException (\ Symfony \Component \Config \Definition \Exception \InvalidConfigurationException::class );
517
517
$ container = $ this ->createContainer ();
518
518
$ loader = new FrameworkExtension ();
519
519
$ loader ->load ([['router ' => true ]], $ container );
@@ -774,14 +774,14 @@ public function testMessengerWithMultipleBuses()
774
774
775
775
public function testMessengerMiddlewareFactoryErroneousFormat ()
776
776
{
777
- $ this ->expectException (' InvalidArgumentException ' );
777
+ $ this ->expectException (\ InvalidArgumentException::class );
778
778
$ this ->expectExceptionMessage ('Invalid middleware at path "framework.messenger": a map with a single factory id as key and its arguments as value was expected, {"foo":["qux"],"bar":["baz"]} given. ' );
779
779
$ this ->createContainerFromFile ('messenger_middleware_factory_erroneous_format ' );
780
780
}
781
781
782
782
public function testMessengerInvalidTransportRouting ()
783
783
{
784
- $ this ->expectException (' LogicException ' );
784
+ $ this ->expectException (\ LogicException::class );
785
785
$ this ->expectExceptionMessage ('Invalid Messenger routing configuration: the "Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage" class is being routed to a sender called "invalid". This is not a valid transport or service id. ' );
786
786
$ this ->createContainerFromFile ('messenger_routing_invalid_transport ' );
787
787
}
@@ -797,19 +797,19 @@ public function testTranslator()
797
797
$ this ->assertSame ($ container ->getParameter ('kernel.cache_dir ' ).'/translations ' , $ options ['cache_dir ' ]);
798
798
799
799
$ files = array_map ('realpath ' , $ options ['resource_files ' ]['en ' ]);
800
- $ ref = new \ReflectionClass (' Symfony\Component\Validator\Validation ' );
800
+ $ ref = new \ReflectionClass (\ Symfony \Component \Validator \Validation::class );
801
801
$ this ->assertContains (
802
802
strtr (\dirname ($ ref ->getFileName ()).'/Resources/translations/validators.en.xlf ' , '/ ' , \DIRECTORY_SEPARATOR ),
803
803
$ files ,
804
804
'->registerTranslatorConfiguration() finds Validator translation resources '
805
805
);
806
- $ ref = new \ReflectionClass (' Symfony\Component\Form\Form ' );
806
+ $ ref = new \ReflectionClass (\ Symfony \Component \Form \Form::class );
807
807
$ this ->assertContains (
808
808
strtr (\dirname ($ ref ->getFileName ()).'/Resources/translations/validators.en.xlf ' , '/ ' , \DIRECTORY_SEPARATOR ),
809
809
$ files ,
810
810
'->registerTranslatorConfiguration() finds Form translation resources '
811
811
);
812
- $ ref = new \ReflectionClass (' Symfony\Component\Security\Core\Security ' );
812
+ $ ref = new \ReflectionClass (\ Symfony \Component \Security \Core \Security::class );
813
813
$ this ->assertContains (
814
814
strtr (\dirname ($ ref ->getFileName ()).'/Resources/translations/security.en.xlf ' , '/ ' , \DIRECTORY_SEPARATOR ),
815
815
$ files ,
@@ -866,7 +866,7 @@ public function testValidation()
866
866
$ container = $ this ->createContainerFromFile ('full ' );
867
867
$ projectDir = $ container ->getParameter ('kernel.project_dir ' );
868
868
869
- $ ref = new \ReflectionClass (' Symfony\Component\Form\Form ' );
869
+ $ ref = new \ReflectionClass (\ Symfony \Component \Form \Form::class );
870
870
$ xmlMappings = [
871
871
\dirname ($ ref ->getFileName ()).'/Resources/config/validation.xml ' ,
872
872
strtr ($ projectDir .'/config/validator/foo.xml ' , '/ ' , \DIRECTORY_SEPARATOR ),
@@ -900,7 +900,7 @@ public function testValidationService()
900
900
{
901
901
$ container = $ this ->createContainerFromFile ('validation_annotations ' , ['kernel.charset ' => 'UTF-8 ' ], false );
902
902
903
- $ this ->assertInstanceOf (' Symfony\Component\Validator\Validator\ValidatorInterface ' , $ container ->get ('validator.alias ' ));
903
+ $ this ->assertInstanceOf (\ Symfony \Component \Validator \Validator \ValidatorInterface::class , $ container ->get ('validator.alias ' ));
904
904
}
905
905
906
906
public function testAnnotations ()
0 commit comments