Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  Fix tests
  replace usages of the deprecated PHPUnit getMockClass() method
  [gha] Fix high-deps to run with Symfony 6+
  Fix PHPDoc (wrong order)
  • Loading branch information
nicolas-grekas committed Feb 14, 2023
2 parents 4ff4988 + 35d62ea commit ed61fa9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Tests/DependencyInjection/WebProfilerExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpKernel\Profiler\Profiler;
use Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface;
use Symfony\Component\Routing\RouterInterface;

class WebProfilerExtensionTest extends TestCase
{
Expand Down Expand Up @@ -55,11 +58,15 @@ protected function setUp(): void

$this->kernel = $this->createMock(KernelInterface::class);

$profiler = $this->createMock(Profiler::class);
$profilerStorage = $this->createMock(ProfilerStorageInterface::class);
$router = $this->createMock(RouterInterface::class);

$this->container = new ContainerBuilder();
$this->container->register('data_collector.dump', DumpDataCollector::class)->setPublic(true);
$this->container->register('error_handler.error_renderer.html', HtmlErrorRenderer::class)->setPublic(true);
$this->container->register('event_dispatcher', EventDispatcher::class)->setPublic(true);
$this->container->register('router', $this->getMockClass('Symfony\\Component\\Routing\\RouterInterface'))->setPublic(true);
$this->container->register('router', $router::class)->setPublic(true);
$this->container->register('twig', 'Twig\Environment')->setPublic(true);
$this->container->register('twig_loader', 'Twig\Loader\ArrayLoader')->addArgument([])->setPublic(true);
$this->container->register('twig', 'Twig\Environment')->addArgument(new Reference('twig_loader'))->setPublic(true);
Expand All @@ -71,9 +78,9 @@ protected function setUp(): void
$this->container->setParameter('kernel.charset', 'UTF-8');
$this->container->setParameter('debug.file_link_format', null);
$this->container->setParameter('profiler.class', ['Symfony\\Component\\HttpKernel\\Profiler\\Profiler']);
$this->container->register('profiler', $this->getMockClass('Symfony\\Component\\HttpKernel\\Profiler\\Profiler'))
$this->container->register('profiler', $profiler::class)
->setPublic(true)
->addArgument(new Definition($this->getMockClass('Symfony\\Component\\HttpKernel\\Profiler\\ProfilerStorageInterface')));
->addArgument(new Definition($profilerStorage::class));
$this->container->setParameter('data_collector.templates', []);
$this->container->set('kernel', $this->kernel);
$this->container->addCompilerPass(new RegisterListenersPass());
Expand Down

0 comments on commit ed61fa9

Please sign in to comment.