Tests the rendering of an area.
public function testRenderArea() {
$view = views_get_view('test_example_area');
$view
->initHandlers();
// Insert a random string to the test area plugin and see whether it is
// rendered for both header, footer and empty text.
$header_string = $this
->randomString();
$footer_string = $this
->randomString();
$empty_string = $this
->randomString();
$view->header['test_example']->options['string'] = $header_string;
$view->header['test_example']->options['empty'] = TRUE;
$view->footer['test_example']->options['string'] = $footer_string;
$view->footer['test_example']->options['empty'] = TRUE;
$view->empty['test_example']->options['string'] = $empty_string;
// Check whether the strings exists in the output.
$output = $view
->preview();
$this
->assertTrue(strpos($output, $header_string) !== FALSE);
$this
->assertTrue(strpos($output, $footer_string) !== FALSE);
$this
->assertTrue(strpos($output, $empty_string) !== FALSE);
}