diff --git a/src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractMethodStaticLoader.php b/src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php similarity index 82% rename from src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractMethodStaticLoader.php rename to src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php index 7c6f362abb..08f219d0a4 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractMethodStaticLoader.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php @@ -4,7 +4,7 @@ namespace Symfony\Component\Validator\Tests\Mapping\Loader; use Symfony\Component\Validator\Mapping\ClassMetadata; -abstract class AbstractMethodStaticLoader +abstract class AbstractStaticMethodLoader { abstract public static function loadMetadata(ClassMetadata $metadata); } diff --git a/src/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php b/src/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php index 3f3889bf0e..0c9690f4e3 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/Loader/StaticMethodLoaderTest.php @@ -90,22 +90,19 @@ class StaticMethodLoaderTest extends \PHPUnit_Framework_TestCase public function testLoadClassMetadataIgnoresAbstractMethods() { - error_reporting(E_ALL | E_STRICT); + // Disable error reporting, as AbstractStaticMethodLoader produces a + // strict standards error + error_reporting(0); + + if (0 !== error_reporting()) { + $this->markTestSkipped('Could not disable error reporting'); + } + + include __DIR__.'/AbstractStaticMethodLoader.php'; + + $metadata = new ClassMetadata(__NAMESPACE__.'\AbstractStaticMethodLoader'); $loader = new StaticMethodLoader('loadMetadata'); - $caught = false; - try { - 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'); $loader->loadClassMetadata($metadata); $this->assertCount(0, $metadata->getConstraints());