OutputTest.php 775 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Copyright (c) 2016 Robin Appelman <robin@icewind.nl>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace Test\AppFramework\Http;
  9. use OC\AppFramework\Http\Output;
  10. class OutputTest extends \Test\TestCase {
  11. public function testSetOutput() {
  12. $this->expectOutputString('foo');
  13. $output = new Output('');
  14. $output->setOutput('foo');
  15. }
  16. public function testSetReadfile() {
  17. $this->expectOutputString(file_get_contents(__FILE__));
  18. $output = new Output('');
  19. $output->setReadfile(__FILE__);
  20. }
  21. public function testSetReadfileStream() {
  22. $this->expectOutputString(file_get_contents(__FILE__));
  23. $output = new Output('');
  24. $output->setReadfile(fopen(__FILE__, 'r'));
  25. }
  26. }