Moved API\Notification tests
This commit is contained in:
parent
f2ca21935e
commit
6725f05ab2
8 changed files with 161 additions and 86 deletions
54
tests/Util/ApiResponseDouble.php
Normal file
54
tests/Util/ApiResponseDouble.php
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
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 = [];
|
||||
}
|
||||
|
||||
protected function setHeader(string $header)
|
||||
{
|
||||
static::$header[] = $header;
|
||||
}
|
||||
|
||||
protected function printOutput(string $output)
|
||||
{
|
||||
static::$output .= $output;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue