add tests for http/output

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2016-11-16 10:58:24 +01:00
parent d5bfff6f4f
commit e4d1cf0f6d
No known key found for this signature in database
GPG Key ID: 425003AC385454C5
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
<?php
/**
* Copyright (c) 2016 Robin Appelman <robin@icewind.nl>
* 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'));
}
}