Skip to content

Commit

Permalink
Merge 1b45b13 into 2806bf8
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienHarper committed Sep 26, 2021
2 parents 2806bf8 + 1b45b13 commit 75825da
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Controller/ViewerController.php
Expand Up @@ -15,6 +15,13 @@

class ViewerController extends AbstractController
{
private $environment;

public function __construct(\Twig\Environment $environment)
{
$this->environment = $environment;
}

/**
* @Route("/audit", name="dh_auditor_list_audits", methods={"GET"})
*/
Expand Down Expand Up @@ -90,4 +97,9 @@ public function showEntityHistoryAction(Request $request, Reader $reader, string
'paginator' => $pager,
]);
}

protected function renderView(string $view, array $parameters = []): string
{
return $this->environment->render($view, $parameters);
}
}
1 change: 1 addition & 0 deletions src/Resources/config/services.yaml
Expand Up @@ -60,6 +60,7 @@ services:

# Bundle related services
DH\AuditorBundle\Controller\ViewerController:
arguments: ['@twig']
calls:
- { method: setContainer, arguments: ['@service_container'] }
tags: ['controller.service_arguments']
Expand Down
2 changes: 2 additions & 0 deletions tests/DHAuditorBundleTest.php
Expand Up @@ -15,6 +15,7 @@
use Nyholm\BundleTest\BaseBundleTestCase;
use Nyholm\BundleTest\CompilerPass\PublicServicePass;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\HttpKernel\Kernel;

/**
Expand Down Expand Up @@ -44,6 +45,7 @@ public function testInitBundle(): void

$kernel->addBundle(DoctrineBundle::class);
$kernel->addBundle(SecurityBundle::class);
$kernel->addBundle(TwigBundle::class);

$this->bootKernel();

Expand Down
2 changes: 2 additions & 0 deletions tests/Twig/Extension/TwigExtensionTest.php
Expand Up @@ -8,6 +8,7 @@
use Nyholm\BundleTest\BaseBundleTestCase;
use Nyholm\BundleTest\CompilerPass\PublicServicePass;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\HttpKernel\Kernel;

/**
Expand Down Expand Up @@ -36,6 +37,7 @@ protected function setUp(): void

$kernel->addBundle(DoctrineBundle::class);
$kernel->addBundle(SecurityBundle::class);
$kernel->addBundle(TwigBundle::class);

$this->bootKernel();

Expand Down

0 comments on commit 75825da

Please sign in to comment.