From e4d1cf0f6db28ba371c9b1ce1cbbe35d535f8c8d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 16 Nov 2016 10:58:24 +0100 Subject: [PATCH] add tests for http/output Signed-off-by: Robin Appelman --- tests/lib/AppFramework/Http/OutputTest.php | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/lib/AppFramework/Http/OutputTest.php diff --git a/tests/lib/AppFramework/Http/OutputTest.php b/tests/lib/AppFramework/Http/OutputTest.php new file mode 100644 index 0000000000..5fe35d24bd --- /dev/null +++ b/tests/lib/AppFramework/Http/OutputTest.php @@ -0,0 +1,31 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace Test\AppFramework\Http; + +use OC\AppFramework\Http\Output; + +class OutputTest extends \Test\TestCase { + public function testSetOutput() { + $this->expectOutputString('foo'); + $output = new Output(''); + $output->setOutput('foo'); + } + + public function testSetReadfile() { + $this->expectOutputString(file_get_contents(__FILE__)); + $output = new Output(''); + $output->setReadfile(__FILE__); + } + + public function testSetReadfileStream() { + $this->expectOutputString(file_get_contents(__FILE__)); + $output = new Output(''); + $output->setReadfile(fopen(__FILE__, 'r')); + } +}