_test_theme_twig_php_values example

\Drupal::service('theme_installer')->install(['test_theme']);
  }

  /** * Tests that the Twig engine handles PHP data correctly. */
  public function testTwigVariableDataTypes() {
    $this->config('system.theme')
      ->set('default', 'test_theme')
      ->save();
    $this->drupalGet('twig-theme-test/php-variables');
    foreach (_test_theme_twig_php_values() as $type => $value) {
      $this->assertSession()->responseContains('<li>' . $type . ': ' . $value['expected'] . '</li>');
    }
  }

  /** * Tests the url and url_generate Twig functions. */
  public function testTwigUrlGenerator() {
    $this->drupalGet('twig-theme-test/url-generator');
    // Find the absolute URL of the current site.     $url_generator = $this->container->get('url_generator');
    
Home | Imprint | This part of the site doesn't use cookies.