File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 20
20
use Symfony \Component \DependencyInjection \Compiler \RegisterEnvVarProcessorsPass ;
21
21
use Symfony \Component \DependencyInjection \Compiler \ValidateEnvPlaceholdersPass ;
22
22
use Symfony \Component \DependencyInjection \ContainerBuilder ;
23
+ use Symfony \Component \DependencyInjection \Exception \RuntimeException ;
23
24
use Symfony \Component \DependencyInjection \Extension \Extension ;
24
25
25
26
class ValidateEnvPlaceholdersPassTest extends TestCase
@@ -59,7 +60,7 @@ public function testDefaultEnvIsValidatedInConfig()
59
60
60
61
public function testDefaultEnvWithoutPrefixIsValidatedInConfig ()
61
62
{
62
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ RuntimeException::class);
63
+ $ this ->expectException (RuntimeException::class);
63
64
$ this ->expectExceptionMessage ('The default value of an env() parameter must be a string or null, but "float" given to "env(FLOATISH)". ' );
64
65
65
66
$ container = new ContainerBuilder ();
@@ -219,7 +220,7 @@ public function testEmptyEnvWhichCannotBeEmptyForScalarNode()
219
220
220
221
public function testEmptyEnvWhichCannotBeEmptyForScalarNodeWithValidation ()
221
222
{
222
- $ this ->expectException (\ Symfony \ Component \ Config \ Definition \ Exception \ InvalidConfigurationException::class);
223
+ $ this ->expectException (InvalidConfigurationException::class);
223
224
$ this ->expectExceptionMessage ('The path "env_extension.scalar_node_not_empty_validated" cannot contain an environment variable when empty values are not allowed by definition and are validated. ' );
224
225
225
226
$ container = new ContainerBuilder ();
Original file line number Diff line number Diff line change 14
14
use PHPUnit \Framework \TestCase ;
15
15
use Symfony \Component \DependencyInjection \ContainerBuilder ;
16
16
use Symfony \Component \DependencyInjection \Exception \InvalidArgumentException ;
17
+ use Symfony \Component \DependencyInjection \Exception \LogicException ;
17
18
use Symfony \Component \DependencyInjection \Extension \Extension ;
18
19
use Symfony \Component \DependencyInjection \Tests \Fixtures \Extension \InvalidConfig \InvalidConfigExtension ;
19
20
use Symfony \Component \DependencyInjection \Tests \Fixtures \Extension \SemiValidConfig \SemiValidConfigExtension ;
@@ -71,7 +72,7 @@ public function testSemiValidConfiguration()
71
72
72
73
public function testInvalidConfiguration ()
73
74
{
74
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ LogicException::class);
75
+ $ this ->expectException (LogicException::class);
75
76
$ this ->expectExceptionMessage ('The extension configuration class "Symfony \\Component \\DependencyInjection \\Tests \\Fixtures \\Extension \\InvalidConfig \\Configuration" must implement "Symfony \\Component \\Config \\Definition \\ConfigurationInterface". ' );
76
77
77
78
$ extension = new InvalidConfigExtension ();
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ public function testMergeWithDifferentIdentifiersForPlaceholders()
113
113
114
114
public function testResolveEnvRequiresStrings ()
115
115
{
116
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ RuntimeException::class);
116
+ $ this ->expectException (RuntimeException::class);
117
117
$ this ->expectExceptionMessage ('The default value of env parameter "INT_VAR" must be a string or null, "int" given. ' );
118
118
119
119
$ bag = new EnvPlaceholderParameterBag ();
@@ -124,7 +124,7 @@ public function testResolveEnvRequiresStrings()
124
124
125
125
public function testGetDefaultScalarEnv ()
126
126
{
127
- $ this ->expectException (\ Symfony \ Component \ DependencyInjection \ Exception \ RuntimeException::class);
127
+ $ this ->expectException (RuntimeException::class);
128
128
$ this ->expectExceptionMessage ('The default value of an env() parameter must be a string or null, but "int" given to "env(INT_VAR)". ' );
129
129
130
130
$ bag = new EnvPlaceholderParameterBag ();
You can’t perform that action at this time.
0 commit comments