summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CsvTest.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CsvTest.php b/test/CsvTest.php
index ad64826..5ee00c5 100644
--- a/test/CsvTest.php
+++ b/test/CsvTest.php
@@ -204,4 +204,24 @@ EOF;
$csv->prependStreamFilter('string.toupper');
$this->assertFalse($csv->getIterator()->getRealPath());
}
+
+ /**
+ * @runInSeparateProcess
+ */
+ public function testOutput()
+ {
+ $this->csv->output("test.csv");
+ $headers = xdebug_get_headers();
+ $this->assertSame($headers[0], "Content-Type: application/octet-stream");
+ $this->assertSame($headers[1], "Content-Transfer-Encoding: binary");
+ $this->assertSame($headers[2], "Content-Disposition: attachment; filename=\"test.csv\"");
+ }
+
+ /**
+ * @expectedException PHPUnit_Framework_Error
+ */
+ public function testFailedOutput()
+ {
+ $this->csv->output(new DateTime);
+ }
}