xls_export.test 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. class XLSExportViewsDataExportTests extends ViewsDataExportSimpleExportTest {
  3. protected $profile = 'testing';
  4. public static function getInfo() {
  5. return array(
  6. 'name' => 'XLS Export',
  7. 'description' => 'Various tests for exporting to XLS.',
  8. 'group' => 'Views Data Export',
  9. );
  10. }
  11. protected $vde_export_type = 'XLS';
  12. protected function getStylePluginName() {
  13. return 'views_data_export_xls';
  14. }
  15. protected function getExportView($path = 'vde_test') {
  16. // Create the basic view.
  17. $view = $this->getBasicExportView();
  18. $display = $view->new_display('views_data_export', 'Data export', 'vde_test');
  19. $display->override_option('style_plugin', $this->getStylePluginName());
  20. $display->override_option('path', $path);
  21. $expected = '<html>
  22. <head>
  23. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  24. </head>
  25. <body>
  26. <table>
  27. <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>
  28. <tr class="even"><td>2</td><td>George</td><td>27</td> </tr>
  29. <tr class="odd"><td>3</td><td>Ringo</td><td>28</td> </tr>
  30. <tr class="even"><td>4</td><td>Paul</td><td>26</td> </tr>
  31. <tr class="odd"><td>5</td><td>Meredith</td><td>30</td> </tr>
  32. </tbody>
  33. </table>
  34. </body>
  35. </html>';
  36. return array(&$view, $expected);
  37. }
  38. }