Skip to content

Commit

Permalink
Use import instead of FQCN
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark committed Jan 27, 2021
1 parent 2fd8fe8 commit 176e622
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Tests/Compiler/ValidateEnvPlaceholdersPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Symfony\Component\DependencyInjection\Compiler\RegisterEnvVarProcessorsPass;
use Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\Extension\Extension;

class ValidateEnvPlaceholdersPassTest extends TestCase
Expand Down Expand Up @@ -59,7 +60,7 @@ public function testDefaultEnvIsValidatedInConfig()

public function testDefaultEnvWithoutPrefixIsValidatedInConfig()
{
$this->expectException(\Symfony\Component\DependencyInjection\Exception\RuntimeException::class);
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('The default value of an env() parameter must be a string or null, but "float" given to "env(FLOATISH)".');

$container = new ContainerBuilder();
Expand Down Expand Up @@ -219,7 +220,7 @@ public function testEmptyEnvWhichCannotBeEmptyForScalarNode()

public function testEmptyEnvWhichCannotBeEmptyForScalarNodeWithValidation()
{
$this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class);
$this->expectException(InvalidConfigurationException::class);
$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.');

$container = new ContainerBuilder();
Expand Down
3 changes: 2 additions & 1 deletion Tests/Extension/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Tests\Fixtures\Extension\InvalidConfig\InvalidConfigExtension;
use Symfony\Component\DependencyInjection\Tests\Fixtures\Extension\SemiValidConfig\SemiValidConfigExtension;
Expand Down Expand Up @@ -71,7 +72,7 @@ public function testSemiValidConfiguration()

public function testInvalidConfiguration()
{
$this->expectException(\Symfony\Component\DependencyInjection\Exception\LogicException::class);
$this->expectException(LogicException::class);
$this->expectExceptionMessage('The extension configuration class "Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\Extension\\InvalidConfig\\Configuration" must implement "Symfony\\Component\\Config\\Definition\\ConfigurationInterface".');

$extension = new InvalidConfigExtension();
Expand Down
4 changes: 2 additions & 2 deletions Tests/ParameterBag/EnvPlaceholderParameterBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function testMergeWithDifferentIdentifiersForPlaceholders()

public function testResolveEnvRequiresStrings()
{
$this->expectException(\Symfony\Component\DependencyInjection\Exception\RuntimeException::class);
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('The default value of env parameter "INT_VAR" must be a string or null, "int" given.');

$bag = new EnvPlaceholderParameterBag();
Expand All @@ -124,7 +124,7 @@ public function testResolveEnvRequiresStrings()

public function testGetDefaultScalarEnv()
{
$this->expectException(\Symfony\Component\DependencyInjection\Exception\RuntimeException::class);
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('The default value of an env() parameter must be a string or null, but "int" given to "env(INT_VAR)".');

$bag = new EnvPlaceholderParameterBag();
Expand Down

0 comments on commit 176e622

Please sign in to comment.