From d39c531e8b395c3fac7025d744c514e681b2ffa8 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Fri, 16 Nov 2012 16:01:24 -0600 Subject: [PATCH] [zendframework/zf2#2878] Fix regressions - Base formatter was calling a method on itself using self::methodName() notation; changing this to "static" raised an issue, as the method is non-static. - Two tests were essentially testing whether typehinting would correctly prevent non-formatter arguments. These tests were (a) unnecessary, and (b) did not work on all versions of PHP. Removed. --- src/Formatter/Base.php | 2 +- test/Writer/AbstractTest.php | 10 ---------- test/Writer/DbTest.php | 9 --------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/Formatter/Base.php b/src/Formatter/Base.php index 1b971181..a495dfd3 100644 --- a/src/Formatter/Base.php +++ b/src/Formatter/Base.php @@ -52,7 +52,7 @@ public function format($event) foreach ($event as $key => $value) { // Keep extra as an array if ('extra' === $key) { - $event[$key] = static::format($value); + $event[$key] = self::format($value); } else { $event[$key] = $this->normalize($value); } diff --git a/test/Writer/AbstractTest.php b/test/Writer/AbstractTest.php index 68f9a42b..33983619 100644 --- a/test/Writer/AbstractTest.php +++ b/test/Writer/AbstractTest.php @@ -30,16 +30,6 @@ protected function setUp() $this->_writer = new ConcreteWriter(); } - /** - * @group ZF-6085 - */ - public function testSetFormatter() - { - $this->_writer->setFormatter(new SimpleFormatter()); - $this->setExpectedException('PHPUnit_Framework_Error'); - $this->_writer->setFormatter(new \StdClass()); - } - public function testAddFilter() { $this->_writer->addFilter(1); diff --git a/test/Writer/DbTest.php b/test/Writer/DbTest.php index 8a2467a6..41dca67a 100644 --- a/test/Writer/DbTest.php +++ b/test/Writer/DbTest.php @@ -197,15 +197,6 @@ public function testShutdownRemovesReferenceToDatabaseInstance() $this->writer->write(array('message' => 'this should fail')); } - /** - * @group ZF-10089 - */ - public function testThrowStrictSetFormatter() - { - $this->setExpectedException('PHPUnit_Framework_Error'); - $this->writer->setFormatter(new \StdClass()); - } - public function testWriteDateTimeAsTimestamp() { $date = new DateTime();