You are here

public function DevelTwigExtensionTest::testXdebugIntegrationFunctionsRegistered in Devel 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/DevelTwigExtensionTest.php \Drupal\Tests\devel\Kernel\DevelTwigExtensionTest::testXdebugIntegrationFunctionsRegistered()
  2. 8 tests/src/Kernel/DevelTwigExtensionTest.php \Drupal\Tests\devel\Kernel\DevelTwigExtensionTest::testXDebugIntegrationFunctionsRegistered()
  3. 4.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 108

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