From e6add5bd5e5bfb18e5a4996b99a4dc879cd6b60d Mon Sep 17 00:00:00 2001 From: filp Date: Mon, 24 Jun 2013 23:22:06 +0100 Subject: [PATCH] Fix failing PrettyPageHandler tests --- src/Whoops/Handler/PrettyPageHandler.php | 6 +++--- tests/Whoops/Handler/PrettyPageHandlerTest.php | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Whoops/Handler/PrettyPageHandler.php b/src/Whoops/Handler/PrettyPageHandler.php index 0992f56..1e2500b 100644 --- a/src/Whoops/Handler/PrettyPageHandler.php +++ b/src/Whoops/Handler/PrettyPageHandler.php @@ -316,11 +316,11 @@ class PrettyPageHandler extends Handler */ public function getResourcesPath() { - trigger_error(__METHOD__ . " is deprecated by PrettyPageHandler::getResourcePaths", E_DEPRECATED); + trigger_error(__METHOD__ . " is deprecated by PrettyPageHandler::getResourcePaths", E_USER_NOTICE); $allPaths = $this->getResourcePaths(); - // Compat: return only the first path: + // Compat: return only the first path return reset($allPaths) ?: null; } @@ -331,7 +331,7 @@ class PrettyPageHandler extends Handler */ public function setResourcesPath($resourcesPath) { - trigger_error(__METHOD__ . " is deprecated by PrettyPageHandler::addResourcePath", E_DEPRECATED); + trigger_error(__METHOD__ . " is deprecated by PrettyPageHandler::addResourcePath", E_USER_NOTICE); $this->addResourcePath($resourcesPath); } diff --git a/tests/Whoops/Handler/PrettyPageHandlerTest.php b/tests/Whoops/Handler/PrettyPageHandlerTest.php index 3bc6c2a..8558ab9 100644 --- a/tests/Whoops/Handler/PrettyPageHandlerTest.php +++ b/tests/Whoops/Handler/PrettyPageHandlerTest.php @@ -59,26 +59,29 @@ class PrettyPageHandlerTest extends TestCase } /** - * @covers Whoops\Handler\PrettyPageHandler::setResourcesPath - * @covers Whoops\Handler\PrettyPageHandler::getResourcesPath + * @covers Whoops\Handler\PrettyPageHandler::addResourcePath + * @covers Whoops\Handler\PrettyPageHandler::getResourcePaths */ - public function testGetSetResourcesPath() + public function testGetSetResourcePaths() { $path = __DIR__; // guaranteed to be valid! $handler = $this->getHandler(); - $handler->setResourcesPath($path); - $this->assertEquals($path, $handler->getResourcesPath()); + $handler->addResourcePath($path); + $allPaths = $handler->getResourcePaths(); + + $this->assertCount(2, $allPaths); + $this->assertEquals($allPaths[1], $path); } /** - * @covers Whoops\Handler\PrettyPageHandler::setResourcesPath + * @covers Whoops\Handler\PrettyPageHandler::addResourcePath * @expectedException InvalidArgumentException */ public function testSetInvalidResourcesPath() { $path = __DIR__ . '/ZIMBABWE'; // guaranteed to be invalid! - $this->getHandler()->setResourcesPath($path); + $this->getHandler()->addResourcePath($path); } /**