1
0

OutputTest.php 737 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace Test\AppFramework\Http;
  7. use OC\AppFramework\Http\Output;
  8. class OutputTest extends \Test\TestCase {
  9. public function testSetOutput(): void {
  10. $this->expectOutputString('foo');
  11. $output = new Output('');
  12. $output->setOutput('foo');
  13. }
  14. public function testSetReadfile(): void {
  15. $this->expectOutputString(file_get_contents(__FILE__));
  16. $output = new Output('');
  17. $output->setReadfile(__FILE__);
  18. }
  19. public function testSetReadfileStream(): void {
  20. $this->expectOutputString(file_get_contents(__FILE__));
  21. $output = new Output('');
  22. $output->setReadfile(fopen(__FILE__, 'r'));
  23. }
  24. }