1 common.test CommonBackdropRenderTestCase::testBackdropRenderThemeArguments()

Test passing arguments to the theme function.

File

core/modules/simpletest/tests/common.test, line 2009
Tests for common.inc functionality.

Class

CommonBackdropRenderTestCase
Tests for backdrop_render().

Code

function testBackdropRenderThemeArguments() {
  $element = array(
    '#theme' => 'common_test_foo',
  );
  // Test that defaults work.
  $this->assertEqual(backdrop_render($element), 'foobar', 'Defaults work');
  $element = array(
    '#theme' => 'common_test_foo',
    '#foo' => $this->randomName(),
    '#bar' => $this->randomName(),
  );
  // Test that passing arguments to the theme function works.
  $this->assertEqual(backdrop_render($element), $element['#foo'] . $element['#bar'], 'Passing arguments to theme functions works');
}