You are here

protected function DOCExportViewsDataExportTests::getExportView in Views data export 7.3

Same name and namespace in other branches
  1. 7.4 tests/doc_export.test \DOCExportViewsDataExportTests::getExportView()

Get a very basic view and expected output for this style.

Return value

An array containing two elements:

  • A View object, for the export.
  • The expected out from that view, if is was executed without further changes.

Overrides ViewsDataExportSimpleExportTest::getExportView

File

tests/doc_export.test, line 21

Class

DOCExportViewsDataExportTests

Code

protected function getExportView($path = 'vde_test') {

  // Create the basic view.
  $view = $this
    ->getBasicExportView();
  $display = $view
    ->new_display('views_data_export', 'Data export', 'vde_test');
  $display
    ->override_option('style_plugin', $this
    ->getStylePluginName());
  $display
    ->override_option('path', $path);
  $expected = '<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  </head>
  <body>
    <table>
    <thead><tr><th>ID</th><th>Name</th><th>Age</th></tr></thead>    <tbody> <tr class="odd"><td>1</td><td>John</td><td>25</td> </tr>
 <tr class="even"><td>2</td><td>George</td><td>27</td> </tr>
 <tr class="odd"><td>3</td><td>Ringo</td><td>28</td> </tr>
 <tr class="even"><td>4</td><td>Paul</td><td>26</td> </tr>
 <tr class="odd"><td>5</td><td>Meredith</td><td>30</td> </tr>
      </tbody>
    </table>
  </body>
</html>';
  return array(
    &$view,
    $expected,
  );
}