Skip to content

Commit c616137

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: Use ::class keyword when possible
2 parents c439350 + ca03f69 commit c616137

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function testPropertyAccessCacheWithDebug()
137137

138138
public function testCsrfProtectionNeedsSessionToBeEnabled()
139139
{
140-
$this->expectException('LogicException');
140+
$this->expectException(\LogicException::class);
141141
$this->expectExceptionMessage('CSRF protection needs sessions to be enabled.');
142142
$this->createContainerFromFile('csrf_needs_session');
143143
}
@@ -317,21 +317,21 @@ public function testWorkflows()
317317

318318
public function testWorkflowAreValidated()
319319
{
320-
$this->expectException('Symfony\Component\Workflow\Exception\InvalidDefinitionException');
320+
$this->expectException(\Symfony\Component\Workflow\Exception\InvalidDefinitionException::class);
321321
$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".');
322322
$this->createContainerFromFile('workflow_not_valid');
323323
}
324324

325325
public function testWorkflowCannotHaveBothSupportsAndSupportStrategy()
326326
{
327-
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');
327+
$this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class);
328328
$this->expectExceptionMessage('"supports" and "support_strategy" cannot be used together.');
329329
$this->createContainerFromFile('workflow_with_support_and_support_strategy');
330330
}
331331

332332
public function testWorkflowShouldHaveOneOfSupportsAndSupportStrategy()
333333
{
334-
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');
334+
$this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class);
335335
$this->expectExceptionMessage('"supports" or "support_strategy" should be configured.');
336336
$this->createContainerFromFile('workflow_without_support_and_support_strategy');
337337
}
@@ -525,7 +525,7 @@ public function testRouter()
525525

526526
public function testRouterRequiresResourceOption()
527527
{
528-
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidConfigurationException');
528+
$this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class);
529529
$container = $this->createContainer();
530530
$loader = new FrameworkExtension();
531531
$loader->load([['router' => true]], $container);
@@ -796,14 +796,14 @@ public function testMessengerWithMultipleBuses()
796796

797797
public function testMessengerMiddlewareFactoryErroneousFormat()
798798
{
799-
$this->expectException('InvalidArgumentException');
799+
$this->expectException(\InvalidArgumentException::class);
800800
$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.');
801801
$this->createContainerFromFile('messenger_middleware_factory_erroneous_format');
802802
}
803803

804804
public function testMessengerInvalidTransportRouting()
805805
{
806-
$this->expectException('LogicException');
806+
$this->expectException(\LogicException::class);
807807
$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.');
808808
$this->createContainerFromFile('messenger_routing_invalid_transport');
809809
}
@@ -819,19 +819,19 @@ public function testTranslator()
819819
$this->assertSame($container->getParameter('kernel.cache_dir').'/translations', $options['cache_dir']);
820820

821821
$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);
823823
$this->assertContains(
824824
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', \DIRECTORY_SEPARATOR),
825825
$files,
826826
'->registerTranslatorConfiguration() finds Validator translation resources'
827827
);
828-
$ref = new \ReflectionClass('Symfony\Component\Form\Form');
828+
$ref = new \ReflectionClass(\Symfony\Component\Form\Form::class);
829829
$this->assertContains(
830830
strtr(\dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', \DIRECTORY_SEPARATOR),
831831
$files,
832832
'->registerTranslatorConfiguration() finds Form translation resources'
833833
);
834-
$ref = new \ReflectionClass('Symfony\Component\Security\Core\Security');
834+
$ref = new \ReflectionClass(\Symfony\Component\Security\Core\Security::class);
835835
$this->assertContains(
836836
strtr(\dirname($ref->getFileName()).'/Resources/translations/security.en.xlf', '/', \DIRECTORY_SEPARATOR),
837837
$files,
@@ -888,7 +888,7 @@ public function testValidation()
888888
$container = $this->createContainerFromFile('full');
889889
$projectDir = $container->getParameter('kernel.project_dir');
890890

891-
$ref = new \ReflectionClass('Symfony\Component\Form\Form');
891+
$ref = new \ReflectionClass(\Symfony\Component\Form\Form::class);
892892
$xmlMappings = [
893893
\dirname($ref->getFileName()).'/Resources/config/validation.xml',
894894
strtr($projectDir.'/config/validator/foo.xml', '/', \DIRECTORY_SEPARATOR),
@@ -922,7 +922,7 @@ public function testValidationService()
922922
{
923923
$container = $this->createContainerFromFile('validation_annotations', ['kernel.charset' => 'UTF-8'], false);
924924

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'));
926926
}
927927

928928
public function testAnnotations()

0 commit comments

Comments
 (0)