diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php index 90a60f5..75f3af7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php @@ -46,15 +46,15 @@ function setUp() { * - any attributes set in the template's preprocessing function */ function testAttributeMerging() { - $output = theme('theme_test_render_element', array( + $theme_test_render_element = array( 'elements' => array( '#attributes' => array('data-foo' => 'bar'), ), 'attributes' => array( 'id' => 'bazinga', ), - )); - $this->assertIdentical($output, '
' . "\n"); + ); + $this->assertThemeOutput('theme_test_render_element', $theme_test_render_element, '' . "\n"); } /** @@ -204,7 +204,7 @@ function testThemeGetSetting() { * Ensures the theme registry is rebuilt when modules are disabled/enabled. */ function testRegistryRebuild() { - $this->assertIdentical(theme('theme_test_foo', array('foo' => 'a')), 'a', 'The theme registry contains theme_test_foo.'); + $this->assertThemeOutput('theme_test_foo', array('foo' => 'a'), 'a', 'The theme registry contains theme_test_foo.'); module_disable(array('theme_test'), FALSE); // After enabling/disabling a module during a test, we need to rebuild the @@ -212,7 +212,7 @@ function testRegistryRebuild() { // throws an exception. $this->rebuildContainer(); $this->container->get('module_handler')->loadAll(); - $this->assertIdentical(theme('theme_test_foo', array('foo' => 'b')), FALSE, 'The theme registry does not contain theme_test_foo, because the module is disabled.'); + $this->assertThemeOutput('theme_test_foo', array('foo' => 'b'), FALSE, 'The theme registry does not contain theme_test_foo, because the module is disabled.'); module_enable(array('theme_test'), FALSE); // After enabling/disabling a module during a test, we need to rebuild the @@ -220,7 +220,7 @@ function testRegistryRebuild() { // throws an exception. $this->rebuildContainer(); $this->container->get('module_handler')->loadAll(); - $this->assertIdentical(theme('theme_test_foo', array('foo' => 'c')), 'c', 'The theme registry contains theme_test_foo again after re-enabling the module.'); + $this->assertThemeOutput('theme_test_foo', array('foo' => 'c'), 'c', 'The theme registry contains theme_test_foo again after re-enabling the module.'); } /** @@ -233,7 +233,7 @@ function testDrupalRenderChildren() { '#markup' => 'Foo', ), ); - $this->assertIdentical(theme('theme_test_render_element_children', $element), 'Foo', 'drupal_render() avoids #theme recursion loop when rendering a render element.'); + $this->assertThemeOutput('theme_test_render_element_children', $element, 'Foo', 'drupal_render() avoids #theme recursion loop when rendering a render element.'); $element = array( '#theme_wrappers' => array('theme_test_render_element_children'), @@ -241,7 +241,7 @@ function testDrupalRenderChildren() { '#markup' => 'Foo', ), ); - $this->assertIdentical(theme('theme_test_render_element_children', $element), 'Foo', 'drupal_render() avoids #theme_wrappers recursion loop when rendering a render element.'); + $this->assertThemeOutput('theme_test_render_element_children', $element, 'Foo', 'drupal_render() avoids #theme_wrappers recursion loop when rendering a render element.'); } /**