From a94b4e0ae2446a010175185cda9b0febec0fd99c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 30 Apr 2014 09:15:56 +0200 Subject: [PATCH] [Validator] fixed wrong test --- .../Tests/Mapping/Loader/StaticMethodLoaderTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php b/src/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php index f90310cd26..80dac2d866 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php @@ -79,10 +79,16 @@ class StaticMethodLoaderTest extends \PHPUnit_Framework_TestCase public function testLoadClassMetadataIgnoresAbstractMethods() { $loader = new StaticMethodLoader('loadMetadata'); + $caught = false; try { - include __DIR__ . '/AbstractMethodStaticLoader.php'; - $this->fail('AbstractMethodStaticLoader should produce a strict standard error.'); + include __DIR__.'/AbstractMethodStaticLoader.php'; } catch (\Exception $e) { + // catching the PHP notice that is converted to an exception by PHPUnit + $caught = true; + } + + if (!$caught) { + $this->fail('AbstractMethodStaticLoader should produce a strict standard error.'); } $metadata = new ClassMetadata(__NAMESPACE__.'\AbstractMethodStaticLoader');