You are here

protected function ViewsDataExportExporterBaseTest::executeEOF in Views data export 7.4

5 calls to ViewsDataExportExporterBaseTest::executeEOF()
CSVExportViewsDataExportExporterTests::testEOF in tests/exporter_tests/csv.test
DOCExportViewsDataExportExporterTests::testEOF in tests/exporter_tests/doc.test
Test End Of File.
TXTExportViewsDataExportExporterTests::testEOF in tests/exporter_tests/txt.test
Test End Of File.
XLSXExportViewsDataExportExporterTests::testEOF in tests/exporter_tests/xlsx.test
Test End Of File.
XMLExportViewsDataExportExporterTests::testEOF in tests/exporter_tests/xml.test
Test End Of File.

File

tests/exporter_tests/base.test, line 46

Class

ViewsDataExportExporterBaseTest

Code

protected function executeEOF($exporter) {

  // Write to memory, rather than an actual file.
  $file = fopen('php://memory', 'w+');

  // Get the exporter to write the Beginning Of File content.
  $exporter
    ->eof($file, 5, 5);

  // Get the content of the file.
  fseek($file, 0);
  $contents = '';
  while (!feof($file)) {
    $contents .= fread($file, 8192);
  }

  // Close up the file stream.
  fclose($file);

  // Return the contents for verification.
  return $contents;
}