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