diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-06-03 14:19:10 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-06-03 14:19:10 +0100 |
| commit | 69c8d4f5c90cef75da102f92e4e992d03a8f1cd8 (patch) | |
| tree | 4f956848961891482b64ee2cd5c8d7290936e354 /vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php | |
| parent | 425f99bc29ab9e477e5407b5c86da5c85ba47461 (diff) | |
| download | webtrees-69c8d4f5c90cef75da102f92e4e992d03a8f1cd8.tar.gz webtrees-69c8d4f5c90cef75da102f92e4e992d03a8f1cd8.tar.bz2 webtrees-69c8d4f5c90cef75da102f92e4e992d03a8f1cd8.zip | |
:Update vendor dependencies
Diffstat (limited to 'vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php')
| -rw-r--r-- | vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php b/vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php index 155493d7f4..d6f0ff7771 100644 --- a/vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php +++ b/vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php @@ -17,9 +17,11 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Controller\ControllerReference; +use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Fragment\InlineFragmentRenderer; use Symfony\Component\HttpKernel\HttpKernel; use Symfony\Component\HttpKernel\KernelEvents; +use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; class InlineFragmentRendererTest extends TestCase { @@ -72,7 +74,7 @@ class InlineFragmentRendererTest extends TestCase */ public function testRenderExceptionNoIgnoreErrors() { - $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock(); + $dispatcher = $this->getMockBuilder(EventDispatcherInterface::class)->getMock(); $dispatcher->expects($this->never())->method('dispatch'); $strategy = new InlineFragmentRenderer($this->getKernel($this->throwException(new \RuntimeException('foo'))), $dispatcher); @@ -82,12 +84,16 @@ class InlineFragmentRendererTest extends TestCase public function testRenderExceptionIgnoreErrors() { - $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock(); - $dispatcher->expects($this->once())->method('dispatch')->with(KernelEvents::EXCEPTION); + $exception = new \RuntimeException('foo'); + $kernel = $this->getKernel($this->throwException($exception)); + $request = Request::create('/'); + $expectedEvent = new ExceptionEvent($kernel, $request, $kernel::SUB_REQUEST, $exception); + $dispatcher = $this->getMockBuilder(EventDispatcherInterface::class)->getMock(); + $dispatcher->expects($this->once())->method('dispatch')->with($expectedEvent, KernelEvents::EXCEPTION); - $strategy = new InlineFragmentRenderer($this->getKernel($this->throwException(new \RuntimeException('foo'))), $dispatcher); + $strategy = new InlineFragmentRenderer($kernel, $dispatcher); - $this->assertEmpty($strategy->render('/', Request::create('/'), ['ignore_errors' => true])->getContent()); + $this->assertEmpty($strategy->render('/', $request, ['ignore_errors' => true])->getContent()); } public function testRenderExceptionIgnoreErrorsWithAlt() |
