function DevelTwigExtensionTest::testXdebugIntegrationFunctionsRegistered

Same name in other branches
  1. 5.x tests/src/Kernel/DevelTwigExtensionTest.php \Drupal\Tests\devel\Kernel\DevelTwigExtensionTest::testXdebugIntegrationFunctionsRegistered()

Tests that the Twig function for XDebug integration is registered properly.

File

tests/src/Kernel/DevelTwigExtensionTest.php, line 111

Class

DevelTwigExtensionTest
Tests Twig extensions.

Namespace

Drupal\Tests\devel\Kernel

Code

public function testXdebugIntegrationFunctionsRegistered() {
    
    /** @var \Twig_SimpleFunction $function */
    $function = \Drupal::service('twig')->getFunction('devel_breakpoint');
    $this->assertTrue($function instanceof \Twig_SimpleFunction);
    $this->assertEquals($function->getName(), 'devel_breakpoint');
    $this->assertTrue($function->needsContext());
    $this->assertTrue($function->needsEnvironment());
    $this->assertTrue($function->isVariadic());
    is_callable($function->getCallable(), TRUE, $callable);
    $this->assertEquals($callable, 'Drupal\\devel\\Twig\\Extension\\Debug::breakpoint');
}