protected function TXTExportViewsDataExportExporterTests::testBodyWrite in Views data export 7.4
Test that content rows are written correctly.
File
- tests/
exporter_tests/ txt.test, line 43
Class
Code
protected function testBodyWrite() {
$miniDataSet = array(
array(
'name' => 'John',
'age' => 25,
'job' => 'Singer',
'created' => gmmktime(0, 0, 0, 1, 1, 2000),
),
);
$result = $this
->executeFullWrite($this
->getExporter(), $miniDataSet, 0, array(
'name' => 'Name',
'age' => 'Age',
'job' => 'Job',
'created' => 'Created',
));
$expected = '[Name]
John
[Age]
25
[Job]
Singer
[Created]
946684800
----------------------------------------
';
$this
->logVerboseResult($result, 'Actual result');
$this
->logVerboseResult($expected, 'Expected result');
$this
->assertEqual($result, $expected, 'The content is as expected.');
}