@@ -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
}
@@ -525,7 +525,7 @@ public function testRouter()
525
525
526
526
public function testRouterRequiresResourceOption ()
527
527
{
528
- $ this ->expectException (' Symfony\Component\Config\Definition\Exception\InvalidConfigurationException ' );
528
+ $ this ->expectException (\ Symfony \Component \Config \Definition \Exception \InvalidConfigurationException::class );
529
529
$ container = $ this ->createContainer ();
530
530
$ loader = new FrameworkExtension ();
531
531
$ loader ->load ([['router ' => true ]], $ container );
@@ -796,14 +796,14 @@ public function testMessengerWithMultipleBuses()
796
796
797
797
public function testMessengerMiddlewareFactoryErroneousFormat ()
798
798
{
799
- $ this ->expectException (' InvalidArgumentException ' );
799
+ $ this ->expectException (\ InvalidArgumentException::class );
800
800
$ 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. ' );
801
801
$ this ->createContainerFromFile ('messenger_middleware_factory_erroneous_format ' );
802
802
}
803
803
804
804
public function testMessengerInvalidTransportRouting ()
805
805
{
806
- $ this ->expectException (' LogicException ' );
806
+ $ this ->expectException (\ LogicException::class );
807
807
$ 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. ' );
808
808
$ this ->createContainerFromFile ('messenger_routing_invalid_transport ' );
809
809
}
@@ -819,19 +819,19 @@ public function testTranslator()
819
819
$ this ->assertSame ($ container ->getParameter ('kernel.cache_dir ' ).'/translations ' , $ options ['cache_dir ' ]);
820
820
821
821
$ files = array_map ('realpath ' , $ options ['resource_files ' ]['en ' ]);
822
- $ ref = new \ReflectionClass (' Symfony\Component\Validator\Validation ' );
822
+ $ ref = new \ReflectionClass (\ Symfony \Component \Validator \Validation::class );
823
823
$ this ->assertContains (
824
824
strtr (\dirname ($ ref ->getFileName ()).'/Resources/translations/validators.en.xlf ' , '/ ' , \DIRECTORY_SEPARATOR ),
825
825
$ files ,
826
826
'->registerTranslatorConfiguration() finds Validator translation resources '
827
827
);
828
- $ ref = new \ReflectionClass (' Symfony\Component\Form\Form ' );
828
+ $ ref = new \ReflectionClass (\ Symfony \Component \Form \Form::class );
829
829
$ this ->assertContains (
830
830
strtr (\dirname ($ ref ->getFileName ()).'/Resources/translations/validators.en.xlf ' , '/ ' , \DIRECTORY_SEPARATOR ),
831
831
$ files ,
832
832
'->registerTranslatorConfiguration() finds Form translation resources '
833
833
);
834
- $ ref = new \ReflectionClass (' Symfony\Component\Security\Core\Security ' );
834
+ $ ref = new \ReflectionClass (\ Symfony \Component \Security \Core \Security::class );
835
835
$ this ->assertContains (
836
836
strtr (\dirname ($ ref ->getFileName ()).'/Resources/translations/security.en.xlf ' , '/ ' , \DIRECTORY_SEPARATOR ),
837
837
$ files ,
@@ -888,7 +888,7 @@ public function testValidation()
888
888
$ container = $ this ->createContainerFromFile ('full ' );
889
889
$ projectDir = $ container ->getParameter ('kernel.project_dir ' );
890
890
891
- $ ref = new \ReflectionClass (' Symfony\Component\Form\Form ' );
891
+ $ ref = new \ReflectionClass (\ Symfony \Component \Form \Form::class );
892
892
$ xmlMappings = [
893
893
\dirname ($ ref ->getFileName ()).'/Resources/config/validation.xml ' ,
894
894
strtr ($ projectDir .'/config/validator/foo.xml ' , '/ ' , \DIRECTORY_SEPARATOR ),
@@ -922,7 +922,7 @@ public function testValidationService()
922
922
{
923
923
$ container = $ this ->createContainerFromFile ('validation_annotations ' , ['kernel.charset ' => 'UTF-8 ' ], false );
924
924
925
- $ this ->assertInstanceOf (' Symfony\Component\Validator\Validator\ValidatorInterface ' , $ container ->get ('validator.alias ' ));
925
+ $ this ->assertInstanceOf (\ Symfony \Component \Validator \Validator \ValidatorInterface::class , $ container ->get ('validator.alias ' ));
926
926
}
927
927
928
928
public function testAnnotations ()
0 commit comments