You are here

protected function ViewsDataExportExporterBaseTest::executeBOF in Views data export 7.4

6 calls to ViewsDataExportExporterBaseTest::executeBOF()
CSVExportViewsDataExportExporterTests::testBOF in tests/exporter_tests/csv.test
Test the header writing.
DOCExportViewsDataExportExporterTests::testBOF in tests/exporter_tests/doc.test
Test the header writing.
TXTExportViewsDataExportExporterTests::testBOF in tests/exporter_tests/txt.test
Test the header writing.
XLSXExportViewsDataExportExporterTests::testBOF in tests/exporter_tests/xlsx.test
Test the header writing.
XMLExportViewsDataExportExporterTests::testBOF in tests/exporter_tests/xml.test
Test the opening XML.

... See full list

File

tests/exporter_tests/base.test, line 26

Class

ViewsDataExportExporterBaseTest

Code

protected function executeBOF($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
    ->bof($file);

  // 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;
}