CITestStreamFilter
extends php_user_filter
in package
Used to capture output during unit testing, so that it can be used in assertions.
Table of Contents
Properties
- $buffer : string
- Buffer to capture stream content.
- $registered : bool
- $err : resource|null
- $out : resource|null
Methods
- addErrorFilter() : void
- addOutputFilter() : void
- filter() : int
- This method is called whenever data is read from or written to the attached stream (such as with fread() or fwrite()).
- registration() : void
- removeErrorFilter() : void
- removeOutputFilter() : void
- removeFilter() : void
Properties
$buffer
Buffer to capture stream content.
public
static string
$buffer
= ''
$registered
protected
static bool
$registered
= false
$err
private
static resource|null
$err
$out
private
static resource|null
$out
Methods
addErrorFilter()
public
static addErrorFilter() : void
addOutputFilter()
public
static addOutputFilter() : void
filter()
This method is called whenever data is read from or written to the attached stream (such as with fread() or fwrite()).
public
filter(resource $in, resource $out, int &$consumed, bool $closing) : int
Parameters
- $in : resource
- $out : resource
- $consumed : int
- $closing : bool
Return values
intregistration()
public
static registration() : void
removeErrorFilter()
public
static removeErrorFilter() : void
removeOutputFilter()
public
static removeOutputFilter() : void
removeFilter()
protected
static removeFilter(resource &$stream) : void
Parameters
- $stream : resource