package Default
inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase

 Methods

Assert that the application route match used the given action

assertActionName(string $action) 
Inherited

Parameters

$action

string

Assert the application exception and message

assertApplicationException($type, $message = null
Inherited

Parameters

$type

application exception type

$message

application exception message

Assert that the application route match used the given controller class

assertControllerClass(string $controller) 
Inherited

Parameters

$controller

string

Assert that the application route match used the given controller name

assertControllerName(string $controller) 
Inherited

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

Parameters

$route

string

Assert that the application route match used the given module

assertModuleName(string $module) 
Inherited

Parameters

$module

string

Assert modules were loaded with the module manager

assertModulesLoaded(array $modules) 
Inherited

Parameters

$modules

array

Assert that the application route match used NOT the given action

assertNotActionName(string $action) 
Inherited

Parameters

$action

string

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

assertNotControllerClass(string $controller) 
Inherited

Parameters

$controller

string

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

assertNotControllerName(string $controller) 
Inherited

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

Parameters

$route

string

Assert that the application route match used NOT the given module

assertNotModuleName(string $module) 
Inherited

Parameters

$module

string

Assert modules were not loaded with the module manager

assertNotModulesLoaded(array $modules) 
Inherited

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(integer $code) 
Inherited

Parameters

$code

integer

Assert not template name Assert that a template was not used somewhere in the view model tree

assertNotTemplateName(string $templateName) 
Inherited

Parameters

$templateName

string

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 has the given reason phrase

assertResponseReasonPhrase(string $phrase) 

Parameters

$phrase

string

Assert response status code

assertResponseStatusCode(integer $code) 
Inherited

Parameters

$code

integer

Assert template name Assert that a template was used somewhere in the view model tree

assertTemplateName(string $templateName) 
Inherited

Parameters

$templateName

string

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 a URL Accept a HTTP (simulate a customer action) or console route.

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

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

Parameters

$url

string

$method

stringnull

$params

arraynull

$isXmlHttpRequest

Exceptions

\Exception

Get the application object

getApplication() : \Zend\Mvc\ApplicationInterface
Inherited

Returns

\Zend\Mvc\ApplicationInterface

Get the application config

getApplicationConfig() : array
Inherited

Returns

arraythe application config

Get the service manager of the application object

getApplicationServiceLocator() : \Zend\ServiceManager\ServiceManager
Inherited

Returns

\Zend\ServiceManager\ServiceManager

Get the application request object

getRequest() : \Zend\Stdlib\RequestInterface
Inherited

Returns

\Zend\Stdlib\RequestInterface

Get the application response object

getResponse() : \Zend\Stdlib\ResponseInterface
Inherited

Returns

\Zend\Stdlib\ResponseInterface

Get the trace error flag

getTraceError() : boolean
Inherited

Returns

boolean

Get the usage of the console router or not

getUseConsoleRequest() : boolean
Inherited

Returns

boolean$boolean

Register XPath namespaces

registerXpathNamespaces(array $xpathNamespaces) 

Parameters

$xpathNamespaces

array

Reset the request

reset($keepPersistence = false) : \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase
Inherited

Parameters

$keepPersistence

Returns

\Zend\Test\PHPUnit\Controller\AbstractControllerTestCase

Set the application config

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

Parameters

$applicationConfig

array

Exceptions

\Zend\Stdlib\Exception\LogicException

Returns

\Zend\Test\PHPUnit\Controller\AbstractControllerTestCase

Set the trace error flag

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

Parameters

$traceError

boolean

Returns

\Zend\Test\PHPUnit\Controller\AbstractControllerTestCase

Set the usage of the console router or not

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

Parameters

$boolean

boolean

Returns

\Zend\Test\PHPUnit\Controller\AbstractControllerTestCase

Trigger an application event

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

Parameters

$eventName

string

Returns

\Zend\EventManager\ResponseCollection

Set the request URL

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

Parameters

$url

string

$method

stringnull

$params

arraynull

Returns

\Zend\Test\PHPUnit\Controller\AbstractControllerTestCase

Get the full current controller class name

getControllerFullClassName() : string
Inherited

Returns

string

Get response header by key

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

Parameters

$header

string

Returns

\Zend\Http\Header\HeaderInterfacefalse

Retrieve the response status code

getResponseStatusCode() : integer
Inherited

Returns

integer

Recursively search a view model and it's children for the given templateName

searchTemplates(\Zend\View\Model\ModelInterface $viewModel, string $templateName) : boolean
Inherited

Parameters

$viewModel

\Zend\View\Model\ModelInterface

$templateName

string

Returns

boolean

Reset the application for isolation

setUp() 
Inherited

Restore params

tearDown() 
Inherited

Assert against DOM/XPath selection

notQueryAssertion(string $path, boolean $useXpath = false

Parameters

$path

string

CSS selector path

$useXpath

boolean

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

notQueryContentContainsAssertion(string $path, string $match, boolean $useXpath = false

Parameters

$path

string

CSS selector path

$match

string

content that should NOT be contained in matched nodes

$useXpath

boolean

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

notQueryContentRegexAssertion(string $path, string $pattern, boolean $useXpath = false

Parameters

$path

string

CSS selector path

$pattern

string

pattern that should NOT be contained in matched nodes

$useXpath

boolean

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

notQueryCountAssertion(string $path, string $count, boolean $useXpath = false

Parameters

$path

string

CSS selector path

$count

string

Number of nodes that should NOT match

$useXpath

boolean

Execute a DOM/XPath query

query(string $path, boolean $useXpath = false) : \Zend\Dom\Document\NodeList

Parameters

$path

string

$useXpath

boolean

Returns

\Zend\Dom\Document\NodeList

Assert against DOM/XPath selection

queryAssertion(string $path, boolean $useXpath = false

Parameters

$path

string

$useXpath

boolean

Assert against DOM/XPath selection; node should contain content

queryContentContainsAssertion(string $path, string $match, boolean $useXpath = false

Parameters

$path

string

CSS selector path

$match

string

content that should be contained in matched nodes

$useXpath

boolean

Assert against DOM/XPath selection; node should match content

queryContentRegexAssertion(string $path, string $pattern, boolean $useXpath = false

Parameters

$path

string

CSS selector path

$pattern

string

Pattern that should be contained in matched nodes

$useXpath

boolean

Count the dom query executed

queryCount(string $path) : integer

Parameters

$path

string

Returns

integer

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

queryCountAssertion(string $path, string $count, boolean $useXpath = false

Parameters

$path

string

CSS selector path

$count

string

Number of nodes that should match

$useXpath

boolean

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

queryCountMaxAssertion(string $path, string $count, boolean $useXpath = false

Parameters

$path

string

CSS selector path

$count

string

Maximum number of nodes that should match

$useXpath

boolean

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

queryCountMinAssertion(string $path, string $count, boolean $useXpath = false

Parameters

$path

string

CSS selector path

$count

string

Minimum number of nodes that should match

$useXpath

boolean

Execute a xpath query

xpathQuery(string $path) : array

Parameters

$path

string

Returns

array

Count the dom query executed

xpathQueryCount(string $path) : integer

Parameters

$path

string

Returns

integer

 Properties

 

$application

$application : \Zend\Mvc\ApplicationInterface

Default

 

$applicationConfig

$applicationConfig : array

Default

 

Trace error when exception is throwed in application

$traceError : boolean

Default

true
 

HTTP controller must not use the console request

$useConsoleRequest : boolean

Default

false
inherited_from \Zend\Test\PHPUnit\Controller\AbstractControllerTestCase::useConsoleRequest
 

Flag to use console router or not

$useConsoleRequest : boolean

Default

false
 

Flag console used before tests

$usedConsoleBackup : boolean

Default

 

XPath namespaces

$xpathNamespaces : array

Default

array()