You are here

function RenderElementTypesTestCase::assertElements in Drupal 7

Asserts that an array of elements is rendered properly.

Parameters

array $elements: An array of associative arrays describing render elements and their expected markup. Each item in $elements must contain the following:

  • 'name': This human readable description will be displayed on the test results page.
  • 'value': This is the render element to test.
  • 'expected': This is the expected markup for the element in 'value'.
2 calls to RenderElementTypesTestCase::assertElements()
RenderElementTypesTestCase::testContainer in modules/simpletest/tests/theme.test
Tests system #type 'container'.
RenderElementTypesTestCase::testHtmlTag in modules/simpletest/tests/theme.test
Tests system #type 'html_tag'.

File

modules/simpletest/tests/theme.test, line 480
Tests for the theme API.

Class

RenderElementTypesTestCase
Tests the markup of core render element types passed to drupal_render().

Code

function assertElements($elements) {
  foreach ($elements as $element) {
    $this
      ->assertIdentical(drupal_render($element['value']), $element['expected'], '"' . $element['name'] . '" input rendered correctly by drupal_render().');
  }
}