Commit 426cde53 authored by Fabien Potencier's avatar Fabien Potencier

fixed compatibility with 2.7

parent 5f661aa1
......@@ -4,6 +4,7 @@ Changelog
1.3.0 (2015-XX-XX)
------------------
* deprecated `$app['exception_handler']->disable()` in favor of `unset($app['exception_handler'])`
* made Silex compatible with Symfony 2.7 (and keep compatibility with Symfony 2.3, 2.5, and 2.6)
* removed deprecated TwigCoreExtension class (register the new HttpFragmentServiceProvider instead)
* bumped minimum version of PHP to 5.3.9
......
......@@ -221,9 +221,9 @@ don't want to mess with most of them.
the request that is used by the Router and the UrlGenerator.
* **exception_handler**: The Exception handler is the default handler that is
used when you don't register one via the ``error()`` method or if your handler
does not return a Response. Disable it with
``$app['exception_handler']->disable()``.
used when you don't register one via the ``error()`` method or if your
handler does not return a Response. Disable it with
``unset($app['exception_handler'])``.
* **logger**: A ``Psr\Log\LoggerInterface`` instance. By default, logging is
disabled as the value is set to ``null``. To enable logging you can either use
......
......@@ -108,7 +108,7 @@ executed before every test.
{
$app = require __DIR__.'/path/to/app.php';
$app['debug'] = true;
$app['exception_handler']->disable();
unset($app['exception_handler']);
return $app;
}
......
......@@ -32,6 +32,9 @@ class ExceptionHandler implements EventSubscriberInterface
$this->enabled = true;
}
/**
* @deprecated since 1.3, to be removed in 2.0
*/
public function disable()
{
$this->enabled = false;
......
......@@ -525,7 +525,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testGetRouteCollectionWithRouteWithoutController()
{
$app = new Application();
$app['exception_handler']->disable();
unset($app['exception_handler']);
$app->match('/')->bind('homepage');
$app->handle(Request::create('/'));
}
......
......@@ -107,7 +107,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
public function testNoExceptionHandler()
{
$app = new Application();
$app['exception_handler']->disable();
unset($app['exception_handler']);
$app->match('/foo', function () {
throw new \RuntimeException('foo exception');
......@@ -207,6 +207,8 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
$this->fail('->handle() should not catch exceptions where an empty error handler was supplied');
} catch (\RuntimeException $e) {
$this->assertEquals('foo exception', $e->getMessage());
} catch (\LogicException $e) {
$this->assertEquals('foo exception', $e->getPrevious()->getMessage());
}
$this->assertEquals(1, $errors, 'should execute the error handler');
......@@ -261,7 +263,7 @@ class ExceptionHandlerTest extends \PHPUnit_Framework_TestCase
// just making sure the dispatcher gets created
});
$app['exception_handler']->disable();
unset($app['exception_handler']);
try {
$request = Request::create('/foo');
......
......@@ -63,7 +63,7 @@ class RememberMeServiceProviderTest extends WebTestCase
$app = new Application();
$app['debug'] = true;
$app['exception_handler']->disable();
unset($app['exception_handler']);
$app->register(new SessionServiceProvider(), array(
'session.test' => true,
......
......@@ -94,7 +94,7 @@ class SessionServiceProviderTest extends WebTestCase
});
$app['debug'] = true;
$app['exception_handler']->disable();
unset($app['exception_handler']);
$client = new Client($app);
......
......@@ -100,7 +100,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase
public function testMissingRoute()
{
$app = new Application();
$app['exception_handler']->disable();
unset($app['exception_handler']);
$request = Request::create('/baz');
$app->handle($request);
......
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