function RenderExampleTestCase::assertRenderedText

Asserts that the string value of the result is the same as the passed text.

Parameters

array $xpath_array: Array of keyed arrays of tests to be made. Each child array consists of $xpath => $expected_text

1 call to RenderExampleTestCase::assertRenderedText()
RenderExampleTestCase::testRenderExampleBasic in render_example/render_example.test
Basic test of rendering through user interaction.

File

render_example/render_example.test, line 56

Class

RenderExampleTestCase
Functional tests for the Render Example module.

Code

public function assertRenderedText($xpath_array) {
    foreach ($xpath_array as $xpath => $text) {
        $result = $this->xpath($xpath);
        $this->assertTrue((string) $result[0][0] == $text, format_string('%ary selects text %text', array(
            '%ary' => $xpath,
            '%text' => $text,
        )));
    }
}