You are here

protected function ViewsDataExportSimpleExportTest::executeAndCompareGivenView in Views data export 7.4

Same name and namespace in other branches
  1. 7.3 tests/base.test \ViewsDataExportSimpleExportTest::executeAndCompareGivenView()

Execute a given view very simply.

This will take a view, and add a display plugin of the correct export type, and then run it and compare it with the expected output.

9 calls to ViewsDataExportSimpleExportTest::executeAndCompareGivenView()
CSVExportViewsDataExportTests::testIconvEncoding in tests/csv_export.test
Test to ensure that Encoding options work.
CSVExportViewsDataExportTests::testKeepHTML in tests/csv_export.test
Test to ensure that HTML tags are kept in CSV files when requested.
CSVExportViewsDataExportTests::testTrimFields in tests/csv_export.test
Test to ensure that HTML tags are kept in CSV files when requested.
TXTExportViewsDataExportTests::testHideEmptySupport in tests/txt_export.test
Test to check if empty fields are correctly hidden.
XMLExportViewsDataExportTests::testCustomiseXMLNodes in tests/xml_export.test
Test to ensure that XML nodes names can be manually specified.

... See full list

File

tests/base.test, line 485

Class

ViewsDataExportSimpleExportTest

Code

protected function executeAndCompareGivenView(view $view, $expected, $message = '', $style_options = array()) {
  $path = 'vde_test/' . $this
    ->randomName();
  $display = $view
    ->new_display('views_data_export', 'Data export', 'vde_test');
  $display
    ->override_option('style_plugin', $this
    ->getStylePluginName());
  $display
    ->override_option('style_options', $style_options);
  $display
    ->override_option('path', $path);

  // Save this view so we can hit the path.
  $view
    ->save();

  // Ensure that the menu router system is rebuilt on the next page load.
  variable_set('menu_rebuild_needed', TRUE);
  $this
    ->drupalGet($path);
  $result = $this
    ->drupalGetContent();
  $this
    ->assertExportEqual($result, $expected, $message);
}