Methods

Assert that the application route match used the given action

assertActionName(string $action) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertActionName()

Parameters

$action

string

Assert the application exception and message

assertApplicationException(\Zend\Test\PHPUnit\Controller\$type $type, \Zend\Test\PHPUnit\Controller\$message $message) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertApplicationException()

Parameters

$type

\Zend\Test\PHPUnit\Controller\$type

application exception type

$message

\Zend\Test\PHPUnit\Controller\$message

application exception message

Assert that the application route match used the given controller class

assertControllerClass(string $controller) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertControllerClass()

Parameters

$controller

string

Assert that the application route match used the given controller name

assertControllerName(string $controller) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertControllerName()

Parameters

$controller

string

Assert response header exists

assertHasResponseHeader(string $header) 

Parameters

$header

string

Assert that the application route match used the given route name

assertMatchedRouteName(string $route) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertMatchedRouteName()

Parameters

$route

string

Assert that the application route match used the given module

assertModuleName(string $module) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertModuleName()

Parameters

$module

string

Assert modules were loaded with the module manager

assertModulesLoaded(array $modules) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertModulesLoaded()

Parameters

$modules

array

Assert that the application route match used NOT the given action

assertNotActionName(string $action) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertNotActionName()

Parameters

$action

string

Assert that the application route match used NOT the given controller class

assertNotControllerClass(string $controller) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertNotControllerClass()

Parameters

$controller

string

Assert that the application route match used NOT the given controller name

assertNotControllerName(string $controller) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertNotControllerName()

Parameters

$controller

string

Assert response header does not exist

assertNotHasResponseHeader(string $header) 

Parameters

$header

string

Assert that the application route match used NOT the given route name

assertNotMatchedRouteName(string $route) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertNotMatchedRouteName()

Parameters

$route

string

Assert that the application route match used NOT the given module

assertNotModuleName(string $module) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertNotModuleName()

Parameters

$module

string

Assert modules were not loaded with the module manager

assertNotModulesLoaded(array $modules) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertNotModulesLoaded()

Parameters

$modules

array

Assert against DOM selection

assertNotQuery(string $path) 

Parameters

$path

string

CSS selector path

Assert against DOM selection; node should NOT contain content

assertNotQueryContentContains(string $path, string $match) 

Parameters

$path

string

CSS selector path

$match

string

content that should NOT be contained in matched nodes

Assert against DOM selection; node should NOT match content

assertNotQueryContentRegex(string $path, string $pattern) 

Parameters

$path

string

CSS selector path

$pattern

string

pattern that should NOT be contained in matched nodes

Assert against DOM selection; should NOT contain exact number of nodes

assertNotQueryCount(string $path, string $count) 

Parameters

$path

string

CSS selector path

$count

string

Number of nodes that should NOT match

Assert that response is NOT a redirect

assertNotRedirect() 

Assert that redirect location does not match pattern

assertNotRedirectRegex(string $pattern) 

Parameters

$pattern

string

Assert that response does not redirect to given URL

assertNotRedirectTo(string $url) 

Parameters

$url

string

Assert response header exists and contains the given string

assertNotResponseHeaderContains(string $header, string $match) 

Parameters

$header

string

$match

string

Assert response header does not exist and/or does not match the given regex

assertNotResponseHeaderRegex(string $header, string $pattern) 

Parameters

$header

string

$pattern

string

Assert not response status code

assertNotResponseStatusCode(int $code) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertNotResponseStatusCode()

Parameters

$code

int

Assert against XPath selection

assertNotXpathQuery(string $path) 

Parameters

$path

string

XPath path

Assert against XPath selection; node should NOT contain content

assertNotXpathQueryContentContains(string $path, string $match) 

Parameters

$path

string

XPath path

$match

string

content that should NOT be contained in matched nodes

Assert against XPath selection; node should NOT match content

assertNotXpathQueryContentRegex(string $path, string $pattern) 

Parameters

$path

string

XPath path

$pattern

string

pattern that should NOT be contained in matched nodes

Assert against XPath selection; should NOT contain exact number of nodes

assertNotXpathQueryCount(string $path, string $count) 

Parameters

$path

string

XPath path

$count

string

Number of nodes that should NOT match

Assert against DOM selection

assertQuery(string $path) 

Parameters

$path

string

CSS selector path

Assert against DOM selection; node should contain content

assertQueryContentContains(string $path, string $match) 

Parameters

$path

string

CSS selector path

$match

string

content that should be contained in matched nodes

Assert against DOM selection; node should match content

assertQueryContentRegex(string $path, string $pattern) 

Parameters

$path

string

CSS selector path

$pattern

string

Pattern that should be contained in matched nodes

Assert against DOM selection; should contain exact number of nodes

assertQueryCount(string $path, string $count) 

Parameters

$path

string

CSS selector path

$count

string

Number of nodes that should match

Assert against DOM selection; should contain no more than this number of nodes

assertQueryCountMax(string $path, string $count) 

Parameters

$path

string

CSS selector path

$count

string

Maximum number of nodes that should match

Assert against DOM selection; should contain at least this number of nodes

assertQueryCountMin(string $path, string $count) 

Parameters

$path

string

CSS selector path

$count

string

Minimum number of nodes that should match

Assert that response is a redirect

assertRedirect() 

Assert that redirect location matches pattern

assertRedirectRegex(string $pattern) 

Parameters

$pattern

string

Assert that response redirects to given URL

assertRedirectTo(string $url) 

Parameters

$url

string

Assert response header exists and contains the given string

assertResponseHeaderContains(string $header, string $match) 

Parameters

$header

string

$match

string

Assert response header exists and matches the given pattern

assertResponseHeaderRegex(string $header, string $pattern) 

Parameters

$header

string

$pattern

string

Assert response status code

assertResponseStatusCode(int $code) 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::assertResponseStatusCode()

Parameters

$code

int

Assert against XPath selection

assertXpathQuery(string $path) 

Parameters

$path

string

XPath path

Assert against XPath selection; node should contain content

assertXpathQueryContentContains(string $path, string $match) 

Parameters

$path

string

XPath path

$match

string

content that should be contained in matched nodes

Assert against XPath selection; node should match content

assertXpathQueryContentRegex(string $path, string $pattern) 

Parameters

$path

string

XPath path

$pattern

string

Pattern that should be contained in matched nodes

Assert against XPath selection; should contain exact number of nodes

assertXpathQueryCount(string $path, string $count) 

Parameters

$path

string

XPath path

$count

string

Number of nodes that should match

Assert against XPath selection; should contain no more than this number of nodes

assertXpathQueryCountMax(string $path, string $count) 

Parameters

$path

string

XPath path

$count

string

Maximum number of nodes that should match

Assert against XPath selection; should contain at least this number of nodes

assertXpathQueryCountMin(string $path, string $count) 

Parameters

$path

string

XPath path

$count

string

Minimum number of nodes that should match

Dispatch the MVC with an URL Accept a HTTP (simulate a customer action) or console route.

dispatch(string $url, string | null $method, array | null $params) 
Inherited

The URL provided set the request URI in the request object.

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::dispatch()

Parameters

$url

string

$method

stringnull

$params

arraynull

Exceptions

\Exception

Get the application object

getApplication() : \Zend\Mvc\ApplicationInterface
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::getApplication()

Returns

Get the application config

getApplicationConfig() : array
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::getApplicationConfig()

Returns

arraythe application config

Get the service manager of the application object

getApplicationServiceLocator() : \Zend\ServiceManager\ServiceManager
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::getApplicationServiceLocator()

Returns

Get the application request object

getRequest() : \Zend\Stdlib\RequestInterface
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::getRequest()

Returns

Get the application response object

getResponse() : \Zend\Stdlib\ResponseInterface
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::getResponse()

Returns

Get the trace error flag

getTraceError() : bool
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::getTraceError()

Returns

bool

Get the usage of the console router or not

getUseConsoleRequest() : bool
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::getUseConsoleRequest()

Returns

bool$boolean

Register XPath namespaces

registerXpathNamespaces(array $xpathNamespaces) 

Parameters

$xpathNamespaces

array

Reset the request

reset() : \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::reset()

Returns

Set the application config

setApplicationConfig(array $applicationConfig) : \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::setApplicationConfig()

Parameters

$applicationConfig

array

Exceptions

\Zend\Stdlib\Exception\LogicException

Returns

Set the trace error flag

setTraceError(bool $traceError) : \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::setTraceError()

Parameters

$traceError

bool

Returns

Set the usage of the console router or not

setUseConsoleRequest(bool $boolean) : \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::setUseConsoleRequest()

Parameters

$boolean

bool

Returns

Trigger an application event

triggerApplicationEvent(string $eventName) : \Zend\EventManager\ResponseCollection
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::triggerApplicationEvent()

Parameters

$eventName

string

Returns

Set the request URL

url(string $url, string | null $method, array | null $params) : \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::url()

Parameters

$url

string

$method

stringnull

$params

arraynull

Returns

Get the full current controller class name

getControllerFullClassName() : string
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::getControllerFullClassName()

Returns

string

Get response header by key

getResponseHeader(string $header) : \Zend\Http\Header\HeaderInterface | false

Parameters

$header

string

Returns

Retrieve the response status code

getResponseStatusCode() : int
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::getResponseStatusCode()

Returns

int

Reset the application for isolation

setUp() 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::setUp()

Restore params

tearDown() 
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::tearDown()

Assert against DOM/XPath selection

notQueryAssertion(string $path, bool $useXpath) 

Parameters

$path

string

CSS selector path

$useXpath

bool

Assert against DOM/XPath selection; node should NOT contain content

notQueryContentContainsAssertion(string $path, string $match, bool $useXpath) 

Parameters

$path

string

CSS selector path

$match

string

content that should NOT be contained in matched nodes

$useXpath

bool

Assert against DOM/XPath selection; node should NOT match content

notQueryContentRegexAssertion(string $path, string $pattern, bool $useXpath) 

Parameters

$path

string

CSS selector path

$pattern

string

pattern that should NOT be contained in matched nodes

$useXpath

bool

Assert against DOM/XPath selection; should NOT contain exact number of nodes

notQueryCountAssertion(string $path, string $count, bool $useXpath) 

Parameters

$path

string

CSS selector path

$count

string

Number of nodes that should NOT match

$useXpath

bool

Execute a DOM/XPath query

query(string $path, bool $useXpath) : array

Parameters

$path

string

$useXpath

bool

Returns

array

Assert against DOM/XPath selection

queryAssertion(string $path, bool $useXpath) 

Parameters

$path

string

$useXpath

bool

Assert against DOM/XPath selection; node should contain content

queryContentContainsAssertion(string $path, string $match, bool $useXpath) 

Parameters

$path

string

CSS selector path

$match

string

content that should be contained in matched nodes

$useXpath

bool

Assert against DOM/XPath selection; node should match content

queryContentRegexAssertion(string $path, string $pattern, bool $useXpath) 

Parameters

$path

string

CSS selector path

$pattern

string

Pattern that should be contained in matched nodes

$useXpath

bool

Count the dom query executed

queryCount(string $path) : int

Parameters

$path

string

Returns

int

Assert against DOM/XPath selection; should contain exact number of nodes

queryCountAssertion(string $path, string $count, bool $useXpath) 

Parameters

$path

string

CSS selector path

$count

string

Number of nodes that should match

$useXpath

bool

Assert against DOM/XPath selection; should contain no more than this number of nodes

queryCountMaxAssertion(string $path, string $count, bool $useXpath) 

Parameters

$path

string

CSS selector path

$count

string

Maximum number of nodes that should match

$useXpath

bool

Assert against DOM/XPath selection; should contain at least this number of nodes

queryCountMinAssertion(string $path, string $count, bool $useXpath) 

Parameters

$path

string

CSS selector path

$count

string

Minimum number of nodes that should match

$useXpath

bool

Execute a xpath query

xpathQuery(string $path) : array

Parameters

$path

string

Returns

array

Count the dom query executed

xpathQueryCount(string $path) : int

Parameters

$path

string

Returns

int

 Properties

 

$application

$application : \Zend\Mvc\ApplicationInterface
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::$$application
 

$applicationConfig

$applicationConfig : array
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::$$applicationConfig
 

Trace error when exception is throwed in application

$traceError : bool
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::$$traceError
 

HTTP controller must not use the console request

$useConsoleRequest : bool

 

Flag console used before tests

$usedConsoleBackup : bool
Inherited

inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::$$usedConsoleBackup
 

XPath namespaces

$xpathNamespaces : array