You are here

protected function DOCExportViewsDataExportExporterTests::testBodyWrite in Views data export 7.4

Test that content rows are written correctly.

File

tests/exporter_tests/doc.test, line 92

Class

DOCExportViewsDataExportExporterTests

Code

protected function testBodyWrite() {
  $result = $this
    ->executeFullWrite($this
    ->getExporter(), $this
    ->dataSet(), 0, array(
    'Name',
    'Age',
    'Job',
    'Created',
  ));
  $expected = '        <tr class="odd"><td>John</td><td>25</td><td>Singer</td><td>946684800</td></tr>
        <tr class="even"><td>George</td><td>27</td><td>Singer</td><td>946771200</td></tr>
        <tr class="odd"><td>Ringo</td><td>28</td><td>Drummer</td><td>946708230</td></tr>
        <tr class="even"><td>Paul</td><td>26</td><td>Songwriter</td><td>946706400</td></tr>
        <tr class="odd"><td>Meredith</td><td>30</td><td>Speaker</td><td>946708210</td></tr>
';
  $this
    ->logVerboseResult($result, 'Actual result');
  $this
    ->logVerboseResult($expected, 'Expected result');
  $this
    ->assertEqual($result, $expected, 'The content is as expected.');
}