You are here

protected function XMLExportViewsDataExportExporterTests::testRootNode in Views data export 7.4

Test that the chosen RootNode is used when the option is set.

File

tests/exporter_tests/xml.test, line 191

Class

XMLExportViewsDataExportExporterTests

Code

protected function testRootNode() {

  // Get an exporter. Do it here for code clarity.
  $exporter = $this
    ->getExporter(array(
    'field_labels' => array(
      'name',
      'age',
      'job',
      'created',
    ),
    'root_node' => 'test_document_root',
  ));
  $BOF = $this
    ->executeBOF($exporter);

  // Expect that the document root element be test_document_root.
  $expected = '<test_document_root>';
  $result = strpos($BOF, $expected) > -1;
  $this
    ->logVerboseResult($BOF, 'Actual result');
  $this
    ->logVerboseResult($expected, 'Expected to contain');
  $this
    ->assertTrue($result, 'The Root Node is as expected.');
}