. * */ namespace Friendica\Test\Util; use Friendica\Module\Api\ApiResponse; class ApiResponseDouble extends ApiResponse { /** * The header list * * @var string[][] */ protected static $header = []; /** * The printed output * * @var string */ protected static $output = ''; /** * @return string[] */ public static function getHeader(): array { return static::$header; } /** * @return string */ public static function getOutput(): string { return static::$output; } public static function reset() { self::$output = ''; self::$header = []; } /** * {@inheritDoc} */ public function setHeader(?string $header = null, ?string $key = null): void { if (!isset($header) && !empty($key)) { unset(static::$header[$key]); } if (isset($header)) { if (empty($key)) { static::$header[] = $header; } else { static::$header[$key] = $header; } } } protected function printOutput(string $output) { static::$output .= $output; } }