From 1b1303a8d848df84651a50762dc534915eaedc09 Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Wed, 24 Sep 2014 15:56:15 +0200 Subject: [PATCH] [Validator] Fixed StaticMethodLoaderTest to actually test something --- ...der.php => AbstractStaticMethodLoader.php} | 2 +- .../Mapping/Loader/StaticMethodLoaderTest.php | 21 ++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) rename src/Symfony/Component/Validator/Tests/Mapping/Loader/{AbstractMethodStaticLoader.php => AbstractStaticMethodLoader.php} (82%) 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 7c6f362abb537..08f219d0a412b 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 @@ 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 3f3889bf0ebed..0c9690f4e3508 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 @@ public function testLoadClassMetadataInAbstractClasses() public function testLoadClassMetadataIgnoresAbstractMethods() { - error_reporting(E_ALL | E_STRICT); + // Disable error reporting, as AbstractStaticMethodLoader produces a + // strict standards error + error_reporting(0); - $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 (0 !== error_reporting()) { + $this->markTestSkipped('Could not disable error reporting'); } - if (!$caught) { - $this->fail('AbstractMethodStaticLoader should produce a strict standard error.'); - } + include __DIR__.'/AbstractStaticMethodLoader.php'; - $metadata = new ClassMetadata(__NAMESPACE__.'\AbstractMethodStaticLoader'); + $metadata = new ClassMetadata(__NAMESPACE__.'\AbstractStaticMethodLoader'); + + $loader = new StaticMethodLoader('loadMetadata'); $loader->loadClassMetadata($metadata); $this->assertCount(0, $metadata->getConstraints()); 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