PHP Class Bluz\Tests\TestCase

Author: Anton Shevchuk
Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: bluzphp/framework Class Usage Examples

Protected Properties

Property Type Description
$app Application\Tests\BootstrapTest Application entity

Protected Methods

Method Description
assertArrayHasKeyAndSize ( array | ArrayObject $array, string $key, integer $size, string $message = null ) Assert Array Key has Size
assertArrayHasSize ( array | ArrayObject $array, integer $size, string $message = null ) Assert Array Size
assertEqualsArray ( array $expected, array $actual, string $message = null ) Assert one-level Arrays is Equals
getApp ( ) : BootstrapTest Get Application instance
prepareRequest ( string $path = '', array $query = [], array $params = [], string $method = Request::METHOD_GET, array $headers = [] ) : Psr\Http\Message\ServerRequestInterface | ServerRequest Set new Request instance
resetApp ( ) Reset layout and Request
resetGlobals ( ) Reset super-globals variables
setRequestParams ( string $path = '', array $query = [], array $params = [], string $method = Request::METHOD_GET, array $headers = [] ) : Psr\Http\Message\ServerRequestInterface | ServerRequest Set new Request instance
setUp ( ) Setup TestCase
tearDown ( ) Tear Down

Method Details

assertArrayHasKeyAndSize() protected method

Assert Array Key has Size
protected assertArrayHasKeyAndSize ( array | ArrayObject $array, string $key, integer $size, string $message = null )
$array array | ArrayObject
$key string
$size integer
$message string

assertArrayHasSize() protected method

Assert Array Size
protected assertArrayHasSize ( array | ArrayObject $array, integer $size, string $message = null )
$array array | ArrayObject
$size integer
$message string

assertEqualsArray() protected method

Assert one-level Arrays is Equals
protected assertEqualsArray ( array $expected, array $actual, string $message = null )
$expected array
$actual array
$message string

getApp() protected static method

Get Application instance
protected static getApp ( ) : BootstrapTest
return BootstrapTest

prepareRequest() protected method

Set new Request instance
protected prepareRequest ( string $path = '', array $query = [], array $params = [], string $method = Request::METHOD_GET, array $headers = [] ) : Psr\Http\Message\ServerRequestInterface | ServerRequest
$path string Path part of URI http://host/module/controller/path
$query array $_GET params
$params array $_POST params
$method string HTTP method
$headers array HTTP headers
return Psr\Http\Message\ServerRequestInterface | Zend\Diactoros\ServerRequest

resetApp() protected static method

Reset layout and Request
protected static resetApp ( )

resetGlobals() protected static method

Reset super-globals variables
protected static resetGlobals ( )

setRequestParams() protected method

Set new Request instance
protected setRequestParams ( string $path = '', array $query = [], array $params = [], string $method = Request::METHOD_GET, array $headers = [] ) : Psr\Http\Message\ServerRequestInterface | ServerRequest
$path string Path part of URI http://host/module/controller/path
$query array $_GET params
$params array $_POST params
$method string HTTP method
$headers array HTTP headers
return Psr\Http\Message\ServerRequestInterface | Zend\Diactoros\ServerRequest

setUp() protected method

Setup TestCase
protected setUp ( )

tearDown() protected method

Tear Down
protected tearDown ( )

Property Details

$app protected static property

Application entity
protected static BootstrapTest,Application\Tests $app
return Application\Tests\BootstrapTest