diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php index 9c2105a..1fa595c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php @@ -34,7 +34,7 @@ public static function getInfo() { */ function testTwigDebugMarkup() { $extension = twig_extension(); - theme_enable(array('test_theme')); + \Drupal::service('theme_handler')->enable(array('test_theme')); \Drupal::config('system.theme')->set('default', 'test_theme')->save(); // Enable debug, rebuild the service container, and clear all caches. $this->settingsSet('twig_debug', TRUE); @@ -48,7 +48,8 @@ function testTwigDebugMarkup() { // Create a node and test different features of the debug markup. $node = $this->drupalCreateNode(); - $output = _theme('node', node_view($node)); + $node_output = entity_view($node, 'full'); + $output = drupal_render($node_output); $this->assertTrue(strpos($output, '') !== FALSE, 'Twig debug markup found in theme output when debug is enabled.'); $this->assertTrue(strpos($output, "CALL: _theme('node')") !== FALSE, 'Theme call information found.'); $this->assertTrue(strpos($output, 'x node--1' . $extension . PHP_EOL . ' * node--page' . $extension . PHP_EOL . ' * node' . $extension) !== FALSE, 'Suggested template files found in order and node ID specific template shown as current template.'); @@ -58,14 +59,15 @@ function testTwigDebugMarkup() { // Create another node and make sure the template suggestions shown in the // debug markup are correct. $node2 = $this->drupalCreateNode(); - $output = _theme('node', node_view($node2)); + $node2_output = entity_view($node2, 'full'); + $output = drupal_render($node2_output); $this->assertTrue(strpos($output, '* node--2' . $extension . PHP_EOL . ' * node--page' . $extension . PHP_EOL . ' x node' . $extension) !== FALSE, 'Suggested template files found in order and base template shown as current template.'); // Create another node and make sure the template suggestions shown in the // debug markup are correct. $node3 = $this->drupalCreateNode(); $build = array('#theme' => 'node__foo__bar'); - $build += node_view($node3); + $build += entity_view($node3, 'full');; $output = drupal_render($build); $this->assertTrue(strpos($output, "CALL: _theme('node__foo__bar')") !== FALSE, 'Theme call information found.'); $this->assertTrue(strpos($output, '* node--foo--bar' . $extension . PHP_EOL . ' * node--foo' . $extension . PHP_EOL . ' * node--3' . $extension . PHP_EOL . ' * node--page' . $extension . PHP_EOL . ' x node' . $extension) !== FALSE, 'Suggested template files found in order and base template shown as current template.'); @@ -75,7 +77,8 @@ function testTwigDebugMarkup() { $this->rebuildContainer(); $this->resetAll(); - $output = _theme('node', node_view($node)); + $node_output = entity_view($node, 'full'); + $output = drupal_render($node_output); $this->assertFalse(strpos($output, '') !== FALSE, 'Twig debug markup not found in theme output when debug is disabled.'); } diff --git a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php index 31b25a0..1bfa5f8 100644 --- a/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php +++ b/core/modules/system/tests/modules/theme_test/lib/Drupal/theme_test/ThemeTestController.php @@ -55,7 +55,9 @@ public function testInfoStylesheets() { * A render array containing a theme override. */ public function testTemplate() { - return _theme('theme_test_template_test'); + return array( + '#theme' => 'theme_test_template_test', + ); } /** @@ -65,7 +67,9 @@ public function testTemplate() { * An HTML string containing the themed output. */ public function testSuggestion() { - return _theme(array('theme_test__suggestion', 'theme_test'), array()); + return array( + '#theme' => array('theme_test__suggestion', 'theme_test'), + ); } /** diff --git a/core/modules/system/tests/modules/twig_theme_test/lib/Drupal/twig_theme_test/TwigThemeTestController.php b/core/modules/system/tests/modules/twig_theme_test/lib/Drupal/twig_theme_test/TwigThemeTestController.php index ba2a718..b4817f5 100644 --- a/core/modules/system/tests/modules/twig_theme_test/lib/Drupal/twig_theme_test/TwigThemeTestController.php +++ b/core/modules/system/tests/modules/twig_theme_test/lib/Drupal/twig_theme_test/TwigThemeTestController.php @@ -16,7 +16,8 @@ class TwigThemeTestController { * Menu callback for testing PHP variables in a Twig template. */ public function phpVariablesRender() { - return _theme('twig_theme_test_php_variables'); + $twig_theme_test_php_variables = array('#theme' => 'twig_theme_test_php_variables'); + return drupal_render($twig_theme_test_php_variables); } /**