2016-11-16 04:58:24 -05:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2016-11-16 04:58:24 -05:00
|
|
|
/**
|
2024-05-10 09:09:14 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2016-11-16 04:58:24 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Test\AppFramework\Http;
|
|
|
|
|
|
|
|
|
|
use OC\AppFramework\Http\Output;
|
|
|
|
|
|
|
|
|
|
class OutputTest extends \Test\TestCase {
|
2024-09-15 16:32:31 -04:00
|
|
|
public function testSetOutput(): void {
|
2016-11-16 04:58:24 -05:00
|
|
|
$this->expectOutputString('foo');
|
|
|
|
|
$output = new Output('');
|
|
|
|
|
$output->setOutput('foo');
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-15 16:32:31 -04:00
|
|
|
public function testSetReadfile(): void {
|
2016-11-16 04:58:24 -05:00
|
|
|
$this->expectOutputString(file_get_contents(__FILE__));
|
|
|
|
|
$output = new Output('');
|
|
|
|
|
$output->setReadfile(__FILE__);
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-15 16:32:31 -04:00
|
|
|
public function testSetReadfileStream(): void {
|
2016-11-16 04:58:24 -05:00
|
|
|
$this->expectOutputString(file_get_contents(__FILE__));
|
|
|
|
|
$output = new Output('');
|
|
|
|
|
$output->setReadfile(fopen(__FILE__, 'r'));
|
|
|
|
|
}
|
|
|
|
|
}
|