From 3bb854eb55c36c10e0bb357a6ba44bfe2bd246b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Par=C3=A1da=20J=C3=B3zsef?= Date: Tue, 20 Sep 2016 22:49:22 +0200 Subject: [PATCH 1/2] [DependencyInjection] Fix: use the correct exception class. --- .../EnvPlaceholderParameterBag.php | 1 + .../EnvPlaceholderParameterBagTest.php | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php diff --git a/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php b/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php index 68a9ddd5b80d5..907acd9679cb0 100644 --- a/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php +++ b/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php @@ -12,6 +12,7 @@ namespace Symfony\Component\DependencyInjection\ParameterBag; use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; /** * @author Nicolas Grekas diff --git a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php new file mode 100644 index 0000000000000..88c5b783b3a9e --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php @@ -0,0 +1,27 @@ + + * + * 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 testGetThrowsExceptionWithIfEnvNameContainsNonWordCharacters() + { + $bag = new EnvPlaceholderParameterBag(); + $bag->get('env(%foo%)'); + } +} From 2d1662775b618549bbe4a46de70e222c44235734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Par=C3=A1da=20J=C3=B3zsef?= Date: Tue, 20 Sep 2016 22:56:24 +0200 Subject: [PATCH 2/2] [DependencyInjection] Change unit test method name. --- .../Tests/ParameterBag/EnvPlaceholderParameterBagTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php index 88c5b783b3a9e..563c00203057b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php @@ -19,7 +19,7 @@ class EnvPlaceholderParameterBagTest extends \PHPUnit_Framework_TestCase /** * @expectedException InvalidArgumentException */ - public function testGetThrowsExceptionWithIfEnvNameContainsNonWordCharacters() + public function testGetThrowsInvalidArgumentExceptionIfEnvNameContainsNonWordCharacters() { $bag = new EnvPlaceholderParameterBag(); $bag->get('env(%foo%)'); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy