function DevelTwigExtensionTest::testXDebugIntegrationFunctionsRegistered

Same name in other branches
  1. 4.x tests/src/Kernel/DevelTwigExtensionTest.php \Drupal\Tests\devel\Kernel\DevelTwigExtensionTest::testXdebugIntegrationFunctionsRegistered()
  2. 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 109

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');
}