Skip to content

Commit 8501944

Browse files
author
Henrik Bjornskov
committed
Use Silex Application as TwigServiceProvider is dependent on a lot of services defined there
1 parent 227460b commit 8501944

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

tests/Provider/ExceptionServiceProviderTest.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,31 @@
22

33
namespace Brick\Tests\Provider;
44

5+
use Silex\Application;
56
use Silex\Provider\TwigServiceProvider;
67
use Brick\Provider\ExceptionServiceProvider;
7-
use Pimple\Container;
88

99
class ExceptionServiceProviderTest extends \PHPUnit_Framework_TestCase
1010
{
1111
public function setUp()
1212
{
13-
$this->pimple = new Container([
14-
'exception_handler' => function () {
15-
return 'exception_handler';
16-
},
17-
'logger' => function () {},
18-
]);
19-
20-
$this->pimple->register(new TwigServiceProvider);
21-
$this->pimple->register(new ExceptionServiceProvider);
13+
$this->app = new Application();
14+
15+
$this->app->register(new TwigServiceProvider);
16+
$this->app->register(new ExceptionServiceProvider);
2217
}
2318

2419
public function testOverrideExceptionHandler()
2520
{
26-
$this->assertInstanceOf('Symfony\Component\HttpKernel\EventListener\ExceptionListener', $this->pimple['exception_handler']);
21+
$this->assertInstanceOf('Symfony\Component\HttpKernel\EventListener\ExceptionListener', $this->app['exception_handler']);
2722
}
2823

2924
public function testExceptionController()
3025
{
3126
$provider = new TwigServiceProvider;
32-
$provider->register($this->pimple);
27+
$provider->register($this->app);
3328

34-
$this->assertInstanceOf('Brick\Controller\ExceptionController', $this->pimple['exception_controller']);
29+
$this->assertInstanceOf('Brick\Controller\ExceptionController', $this->app['exception_controller']);
3530
}
3631

3732
}

0 commit comments

Comments
 (0)