function DialogRendererTest::testConstructorRendererArgument

@group legacy @expectedDeprecation The renderer service must be passed to Drupal\Core\Render\MainContent\DialogRenderer::__construct and will be required before Drupal 9.0.0. See https://www.drupal.org/node/3009400

File

core/tests/Drupal/Tests/Core/Controller/DialogRendererTest.php, line 20

Class

DialogRendererTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Render%21MainContent%21DialogRenderer.php/class/DialogRenderer/8.9.x" title="Default main content renderer for dialog requests." class="local">\Drupal\Core\Render\MainContent\DialogRenderer</a> @group Ajax

Namespace

Drupal\Tests\Core\Controller

Code

public function testConstructorRendererArgument() {
    $title_resolver = $this->createMock(TitleResolverInterface::class);
    $container = $this->createMock(ContainerInterface::class);
    $container->expects($this->once())
        ->method('get')
        ->with('renderer')
        ->willReturn(NULL);
    \Drupal::setContainer($container);
    new DialogRenderer($title_resolver);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.