mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Add ContentType Injection for HTTPInputData tests
This commit is contained in:
parent
a69e128fe4
commit
15216266d9
3 changed files with 42 additions and 6 deletions
|
@ -33,9 +33,12 @@ class HTTPInputDataDouble extends HTTPInputData
|
|||
protected static $injectedStream = false;
|
||||
/** @var false|string */
|
||||
protected static $injectedContent = false;
|
||||
/** @var false|string */
|
||||
protected static $injectedContentType = false;
|
||||
|
||||
/**
|
||||
* injects the PHP input stream for a test
|
||||
*
|
||||
* @param false|resource $stream
|
||||
*/
|
||||
public static function setPhpInputStream($stream)
|
||||
|
@ -45,6 +48,7 @@ class HTTPInputDataDouble extends HTTPInputData
|
|||
|
||||
/**
|
||||
* injects the PHP input content for a test
|
||||
*
|
||||
* @param false|string $content
|
||||
*/
|
||||
public static function setPhpInputContent($content)
|
||||
|
@ -52,6 +56,16 @@ class HTTPInputDataDouble extends HTTPInputData
|
|||
self::$injectedContent = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* injects the PHP input content type for a test
|
||||
*
|
||||
* @param false|string $contentType
|
||||
*/
|
||||
public static function setPhpInputContentType($contentType)
|
||||
{
|
||||
self::$injectedContentType = $contentType;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
protected static function getPhpInputStream()
|
||||
{
|
||||
|
@ -63,4 +77,10 @@ class HTTPInputDataDouble extends HTTPInputData
|
|||
{
|
||||
return static::$injectedContent;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
protected static function getContentType()
|
||||
{
|
||||
return static::$injectedContentType;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue