Skip to content

Commit

Permalink
[DependencyInjection] Env parameterbag fix: use the correct exception…
Browse files Browse the repository at this point in the history
… class.
  • Loading branch information
paradajozsef authored and fabpot committed Sep 20, 2016
1 parent fe652a5 commit a6a0251
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions ParameterBag/EnvPlaceholderParameterBag.php
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\DependencyInjection\ParameterBag;

use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;

/**
* @author Nicolas Grekas <p@tchwork.com>
Expand Down
27 changes: 27 additions & 0 deletions Tests/ParameterBag/EnvPlaceholderParameterBagTest.php
@@ -0,0 +1,27 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\DependencyInjection\Tests\ParameterBag;

use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;

class EnvPlaceholderParameterBagTest extends \PHPUnit_Framework_TestCase
{
/**
* @expectedException InvalidArgumentException
*/
public function testGetThrowsInvalidArgumentExceptionIfEnvNameContainsNonWordCharacters()
{
$bag = new EnvPlaceholderParameterBag();
$bag->get('env(%foo%)');
}
}

0 comments on commit a6a0251

Please sign in to comment.