Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Functional testing scaffold for MVC applications
Zend_Controller_Front $_frontController = ''
Zend_Dom_Query $_query = ''
Zend_Controller_Request_Abstract $_request = ''
Zend_Controller_Response_Abstract $_response = ''
mixed $bootstrap = ''
__get(
mixed $name
)
:
void
Overloading for common properties
Provides overloading for request, response, and frontController objects.
__set(
string $name, mixed $value
)
:
void
Overloading: prevent overloading to special properties
_incrementAssertionCount(
)
:
void
Increment assertion count
_resetPlaceholders(
)
:
void
Rest all view placeholders
assertAction(
string $action, string $message
)
:
void
Assert that the last handled request used the given action
assertController(
string $controller, string $message
)
:
void
Assert that the last handled request used the given controller
assertHeader(
string $header, string $message
)
:
void
Assert response header exists
assertHeaderContains(
string $header, string $match, string $message
)
:
void
Assert response header exists and contains the given string
assertHeaderRegex(
string $header, string $pattern, string $message
)
:
void
Assert response header exists and matches the given pattern
assertModule(
string $module, string $message
)
:
void
Assert that the last handled request used the given module
assertNotAction(
string $action, string $message
)
:
void
Assert that the last handled request did NOT use the given action
assertNotController(
string $controller, string $message
)
:
void
Assert that the last handled request did NOT use the given controller
assertNotHeader(
string $header, string $message
)
:
void
Assert response header does not exist
assertNotHeaderContains(
string $header, string $match, string $message
)
:
void
Assert response header does not exist and/or does not contain the given string
assertNotHeaderRegex(
string $header, string $pattern, string $message
)
:
void
Assert response header does not exist and/or does not match the given regex
assertNotModule(
string $module, string $message
)
:
void
Assert that the last handled request did NOT use the given module
assertNotQuery(
string $path, string $message
)
:
void
Assert against DOM selection
assertNotQueryContentContains(
string $path, string $match, string $message
)
:
void
Assert against DOM selection; node should NOT contain content
assertNotQueryContentRegex(
string $path, string $pattern, string $message
)
:
void
Assert against DOM selection; node should NOT match content
assertNotQueryCount(
string $path, string $count, string $message
)
:
void
Assert against DOM selection; should NOT contain exact number of nodes
assertNotRedirect(
string $message
)
:
void
Assert that response is NOT a redirect
assertNotRedirectRegex(
string $pattern, string $message
)
:
void
Assert that redirect location does not match pattern
assertNotRedirectTo(
string $url, string $message
)
:
void
Assert that response does not redirect to given URL
assertNotResponseCode(
int $code, string $message
)
:
void
Assert response code
assertNotRoute(
string $route, string $message
)
:
void
Assert that the route matched is NOT as specified
assertNotXpath(
string $path, string $message
)
:
void
Assert against XPath selection
assertNotXpathContentContains(
string $path, string $match, string $message
)
:
void
Assert against XPath selection; node should NOT contain content
assertNotXpathContentRegex(
string $path, string $pattern, string $message
)
:
void
Assert against XPath selection; node should NOT match content
assertNotXpathCount(
string $path, string $count, string $message
)
:
void
Assert against XPath selection; should NOT contain exact number of nodes
assertQuery(
string $path, string $message
)
:
void
Assert against DOM selection
assertQueryContentContains(
string $path, string $match, string $message
)
:
void
Assert against DOM selection; node should contain content
assertQueryContentRegex(
string $path, string $pattern, string $message
)
:
void
Assert against DOM selection; node should match content
assertQueryCount(
string $path, string $count, string $message
)
:
void
Assert against DOM selection; should contain exact number of nodes
assertQueryCountMax(
string $path, string $count, string $message
)
:
void
Assert against DOM selection; should contain no more than this number of nodes
assertQueryCountMin(
string $path, string $count, string $message
)
:
void
Assert against DOM selection; should contain at least this number of nodes
assertRedirect(
string $message
)
:
void
Assert that response is a redirect
assertRedirectRegex(
string $pattern, string $message
)
:
void
Assert that redirect location matches pattern
assertRedirectTo(
string $url, string $message
)
:
void
Assert that response redirects to given URL
assertResponseCode(
int $code, string $message
)
:
void
Assert response code
assertRoute(
string $route, string $message
)
:
void
Assert that the specified route was used
assertXpath(
string $path, string $message
)
:
void
Assert against XPath selection
assertXpathContentContains(
string $path, string $match, string $message
)
:
void
Assert against XPath selection; node should contain content
assertXpathContentRegex(
string $path, string $pattern, string $message
)
:
void
Assert against XPath selection; node should match content
assertXpathCount(
string $path, string $count, string $message
)
:
void
Assert against XPath selection; should contain exact number of nodes
assertXpathCountMax(
string $path, string $count, string $message
)
:
void
Assert against XPath selection; should contain no more than this number of nodes
assertXpathCountMin(
string $path, string $count, string $message
)
:
void
Assert against XPath selection; should contain at least this number of nodes
bootstrap(
)
:
void
Bootstrap the front controller
Resets the front controller, and then bootstraps it.
If {@link $bootstrap} is a callback, executes it; if it is a file, it include's it. When done, sets the test case request and response objects into the front controller.
dispatch(
string|null $url
=
null
)
:
void
Dispatch the MVC
If a URL is provided, sets it as the request URI in the request object. Then sets test case request and response objects in front controller, disables throwing exceptions, and disables returning the response. Finally, dispatches the front controller.
getFrontController(
)
:
Zend_Controller_Front
Retrieve front controller instance
getQuery(
)
:
Zend_Dom_Query
Retrieve DOM query object
getRequest(
)
:
Zend_Controller_Request_Abstract
Retrieve test case request object
getResponse(
)
:
Zend_Controller_Response_Abstract
Retrieve test case response object
reset(
)
:
void
Reset MVC state
Creates new request/response objects, resets the front controller instance, and resets the action helper broker.
resetRequest(
)
:
Zend_Test_PHPUnit_ControllerTestCase
Reset the request object
Useful for test cases that need to test multiple trips to the server.
resetResponse(
)
:
Zend_Test_PHPUnit_ControllerTestCase
Reset the response object
Useful for test cases that need to test multiple trips to the server.
setUp(
)
:
void
Set up MVC app
Calls {@link bootstrap()} by default