Commit c2fc6583 authored by Fabien Potencier's avatar Fabien Potencier

merged branch igorw/rename-error-handler-test-to-exception-handler (PR #562)

This PR was merged into the master branch.

Commits
-------

d2c42b32 Rename ErrorHandlerTest to ExceptionHandlerTest

Discussion
----------

Rename ErrorHandlerTest to ExceptionHandlerTest
parents 0e69dc22 d2c42b32
...@@ -22,9 +22,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; ...@@ -22,9 +22,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* *
* @author Igor Wiedler <igor@wiedler.ch> * @author Igor Wiedler <igor@wiedler.ch>
*/ */
class ErrorHandlerTest extends \PHPUnit_Framework_TestCase class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
{ {
public function testErrorHandlerExceptionNoDebug() public function testExceptionHandlerExceptionNoDebug()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = false; $app['debug'] = false;
...@@ -39,7 +39,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -39,7 +39,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(500, $response->getStatusCode()); $this->assertEquals(500, $response->getStatusCode());
} }
public function testErrorHandlerExceptionDebug() public function testExceptionHandlerExceptionDebug()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = true; $app['debug'] = true;
...@@ -55,7 +55,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -55,7 +55,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(500, $response->getStatusCode()); $this->assertEquals(500, $response->getStatusCode());
} }
public function testErrorHandlerNotFoundNoDebug() public function testExceptionHandlerNotFoundNoDebug()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = false; $app['debug'] = false;
...@@ -66,7 +66,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -66,7 +66,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(404, $response->getStatusCode()); $this->assertEquals(404, $response->getStatusCode());
} }
public function testErrorHandlerNotFoundDebug() public function testExceptionHandlerNotFoundDebug()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = true; $app['debug'] = true;
...@@ -77,7 +77,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -77,7 +77,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(404, $response->getStatusCode()); $this->assertEquals(404, $response->getStatusCode());
} }
public function testErrorHandlerMethodNotAllowedNoDebug() public function testExceptionHandlerMethodNotAllowedNoDebug()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = false; $app['debug'] = false;
...@@ -91,7 +91,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -91,7 +91,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('GET', $response->headers->get('Allow')); $this->assertEquals('GET', $response->headers->get('Allow'));
} }
public function testErrorHandlerMethodNotAllowedDebug() public function testExceptionHandlerMethodNotAllowedDebug()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = true; $app['debug'] = true;
...@@ -105,7 +105,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -105,7 +105,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('GET', $response->headers->get('Allow')); $this->assertEquals('GET', $response->headers->get('Allow'));
} }
public function testNoErrorHandler() public function testNoExceptionHandler()
{ {
$app = new Application(); $app = new Application();
$app['exception_handler']->disable(); $app['exception_handler']->disable();
...@@ -123,7 +123,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -123,7 +123,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
} }
} }
public function testOneErrorHandler() public function testOneExceptionHandler()
{ {
$app = new Application(); $app = new Application();
...@@ -152,7 +152,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -152,7 +152,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('GET', $response->headers->get('Allow')); $this->assertEquals('GET', $response->headers->get('Allow'));
} }
public function testMultipleErrorHandlers() public function testMultipleExceptionHandlers()
{ {
$app = new Application(); $app = new Application();
...@@ -187,7 +187,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -187,7 +187,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(3, $errors, 'should execute error handlers until a response is returned'); $this->assertEquals(3, $errors, 'should execute error handlers until a response is returned');
} }
public function testNoResponseErrorHandler() public function testNoResponseExceptionHandler()
{ {
$app = new Application(); $app = new Application();
$app['exception_handler']->disable(); $app['exception_handler']->disable();
...@@ -213,7 +213,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -213,7 +213,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(1, $errors, 'should execute the error handler'); $this->assertEquals(1, $errors, 'should execute the error handler');
} }
public function testStringResponseErrorHandler() public function testStringResponseExceptionHandler()
{ {
$app = new Application(); $app = new Application();
...@@ -229,7 +229,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -229,7 +229,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->checkRouteResponse($app, '/foo', 'foo exception handler', 'should accept a string response from the error handler'); $this->checkRouteResponse($app, '/foo', 'foo exception handler', 'should accept a string response from the error handler');
} }
public function testErrorHandlerException() public function testExceptionHandlerException()
{ {
$app = new Application(); $app = new Application();
...@@ -273,7 +273,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -273,7 +273,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
} }
} }
public function testErrorHandlerWithDefaultException() public function testExceptionHandlerWithDefaultException()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = false; $app['debug'] = false;
...@@ -292,7 +292,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -292,7 +292,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(500, $response->getStatusCode()); $this->assertEquals(500, $response->getStatusCode());
} }
public function testErrorHandlerWithStandardException() public function testExceptionHandlerWithStandardException()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = false; $app['debug'] = false;
...@@ -318,7 +318,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -318,7 +318,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertContains('Caught Exception', $response->getContent()); $this->assertContains('Caught Exception', $response->getContent());
} }
public function testErrorHandlerWithSpecifiedException() public function testExceptionHandlerWithSpecifiedException()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = false; $app['debug'] = false;
...@@ -344,7 +344,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -344,7 +344,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertContains('Caught LogicException', $response->getContent()); $this->assertContains('Caught LogicException', $response->getContent());
} }
public function testErrorHandlerWithSpecifiedExceptionInReverseOrder() public function testExceptionHandlerWithSpecifiedExceptionInReverseOrder()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = false; $app['debug'] = false;
...@@ -372,7 +372,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ...@@ -372,7 +372,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertContains('Caught Exception', $response->getContent()); $this->assertContains('Caught Exception', $response->getContent());
} }
public function testErrorHandlerWithArrayStyleCallback() public function testExceptionHandlerWithArrayStyleCallback()
{ {
$app = new Application(); $app = new Application();
$app['debug'] = false; $app['debug'] = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment