1 common.test protected CommonBackdropRenderTestCase::assertRenderedElement(array $element, $xpath, array $xpath_args = array())

File

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

Class

CommonBackdropRenderTestCase
Tests for backdrop_render().

Code

protected function assertRenderedElement(array $element, $xpath, array $xpath_args = array()) {
  $original_element = $element;
  $this->backdropSetContent(backdrop_render($element));
  $this->verbose('<pre>' . check_plain(var_export($original_element, TRUE)) . '</pre>'
    . '<pre>' . check_plain(var_export($element, TRUE)) . '</pre>'
    . '<hr />' . $this->backdropGetContent()
    );

  // @see BackdropWebTestCase::xpath()
  $xpath = $this->buildXPathQuery($xpath, $xpath_args);
  $element += array('#value' => NULL);
  $this->assertFieldByXPath($xpath, $element['#value'], format_string('#type @type was properly rendered.', array(
    '@type' => var_export($element['#type'], TRUE),
  )));
}