--- a/web/lib/Zend/Test/PHPUnit/ControllerTestCase.php Thu May 07 15:10:09 2015 +0200
+++ b/web/lib/Zend/Test/PHPUnit/ControllerTestCase.php Thu May 07 15:16:02 2015 +0200
@@ -14,20 +14,11 @@
*
* @category Zend
* @package Zend_Test
- * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: ControllerTestCase.php 24593 2012-01-05 20:35:02Z matthew $
+ * @version $Id$
*/
-/** @see PHPUnit_Runner_Version */
-require_once 'PHPUnit/Runner/Version.php';
-
-/**
- * Depending on version, include the proper PHPUnit support
- * @see PHPUnit_Autoload
- */
-require_once (version_compare(PHPUnit_Runner_Version::id(), '3.5.0', '>=')) ? 'PHPUnit/Autoload.php' : 'PHPUnit/Framework.php';
-
/** @see Zend_Controller_Front */
require_once 'Zend/Controller/Front.php';
@@ -50,7 +41,7 @@
* @category Zend
* @package Zend_Test
* @subpackage PHPUnit
- * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_TestCase
@@ -90,8 +81,8 @@
* Overloading: prevent overloading to special properties
*
* @param string $name
- * @param mixed $value
- * @return void
+ * @param mixed $value
+ * @throws Zend_Exception
*/
public function __set($name, $value)
{
@@ -107,8 +98,8 @@
*
* Provides overloading for request, response, and frontController objects.
*
- * @param mixed $name
- * @return void
+ * @param mixed $name
+ * @return null|Zend_Controller_Front|Zend_Controller_Request_HttpTestCase|Zend_Controller_Response_HttpTestCase
*/
public function __get($name)
{
@@ -128,8 +119,6 @@
* Set up MVC app
*
* Calls {@link bootstrap()} by default
- *
- * @return void
*/
protected function setUp()
{
@@ -144,8 +133,6 @@
* 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.
- *
- * @return void
*/
final public function bootstrap()
{
@@ -176,8 +163,7 @@
* disables throwing exceptions, and disables returning the response.
* Finally, dispatches the front controller.
*
- * @param string|null $url
- * @return void
+ * @param string|null $url
*/
public function dispatch($url = null)
{
@@ -216,7 +202,6 @@
* instance, and resets the action helper broker.
*
* @todo Need to update Zend_Layout to add a resetInstance() method
- * @return void
*/
public function reset()
{
@@ -234,8 +219,6 @@
/**
* Rest all view placeholders
- *
- * @return void
*/
protected function _resetPlaceholders()
{
@@ -286,9 +269,8 @@
/**
* Assert against DOM selection
*
- * @param string $path CSS selector path
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $message
*/
public function assertQuery($path, $message = '')
{
@@ -304,9 +286,8 @@
/**
* Assert against DOM selection
*
- * @param string $path CSS selector path
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $message
*/
public function assertNotQuery($path, $message = '')
{
@@ -322,10 +303,9 @@
/**
* Assert against DOM selection; node should contain content
*
- * @param string $path CSS selector path
- * @param string $match content that should be contained in matched nodes
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $match content that should be contained in matched nodes
+ * @param string $message
*/
public function assertQueryContentContains($path, $match, $message = '')
{
@@ -341,10 +321,9 @@
/**
* Assert against DOM selection; node should NOT contain content
*
- * @param string $path CSS selector path
- * @param string $match content that should NOT be contained in matched nodes
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $match content that should NOT be contained in matched nodes
+ * @param string $message
*/
public function assertNotQueryContentContains($path, $match, $message = '')
{
@@ -360,10 +339,9 @@
/**
* Assert against DOM selection; node should match content
*
- * @param string $path CSS selector path
- * @param string $pattern Pattern that should be contained in matched nodes
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $pattern Pattern that should be contained in matched nodes
+ * @param string $message
*/
public function assertQueryContentRegex($path, $pattern, $message = '')
{
@@ -379,10 +357,9 @@
/**
* Assert against DOM selection; node should NOT match content
*
- * @param string $path CSS selector path
- * @param string $pattern pattern that should NOT be contained in matched nodes
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $pattern pattern that should NOT be contained in matched nodes
+ * @param string $message
*/
public function assertNotQueryContentRegex($path, $pattern, $message = '')
{
@@ -398,10 +375,9 @@
/**
* Assert against DOM selection; should contain exact number of nodes
*
- * @param string $path CSS selector path
- * @param string $count Number of nodes that should match
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $count Number of nodes that should match
+ * @param string $message
*/
public function assertQueryCount($path, $count, $message = '')
{
@@ -417,10 +393,9 @@
/**
* Assert against DOM selection; should NOT contain exact number of nodes
*
- * @param string $path CSS selector path
- * @param string $count Number of nodes that should NOT match
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $count Number of nodes that should NOT match
+ * @param string $message
*/
public function assertNotQueryCount($path, $count, $message = '')
{
@@ -436,10 +411,9 @@
/**
* Assert against DOM selection; should contain at least this number of nodes
*
- * @param string $path CSS selector path
- * @param string $count Minimum number of nodes that should match
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $count Minimum number of nodes that should match
+ * @param string $message
*/
public function assertQueryCountMin($path, $count, $message = '')
{
@@ -455,10 +429,9 @@
/**
* Assert against DOM selection; should contain no more than this number of nodes
*
- * @param string $path CSS selector path
- * @param string $count Maximum number of nodes that should match
- * @param string $message
- * @return void
+ * @param string $path CSS selector path
+ * @param string $count Maximum number of nodes that should match
+ * @param string $message
*/
public function assertQueryCountMax($path, $count, $message = '')
{
@@ -474,8 +447,7 @@
/**
* Register XPath namespaces
*
- * @param array $xpathNamespaces
- * @return void
+ * @param array $xpathNamespaces
*/
public function registerXpathNamespaces($xpathNamespaces)
{
@@ -485,9 +457,8 @@
/**
* Assert against XPath selection
*
- * @param string $path XPath path
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $message
*/
public function assertXpath($path, $message = '')
{
@@ -504,9 +475,8 @@
/**
* Assert against XPath selection
*
- * @param string $path XPath path
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $message
*/
public function assertNotXpath($path, $message = '')
{
@@ -523,10 +493,9 @@
/**
* Assert against XPath selection; node should contain content
*
- * @param string $path XPath path
- * @param string $match content that should be contained in matched nodes
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $match content that should be contained in matched nodes
+ * @param string $message
*/
public function assertXpathContentContains($path, $match, $message = '')
{
@@ -543,10 +512,9 @@
/**
* Assert against XPath selection; node should NOT contain content
*
- * @param string $path XPath path
- * @param string $match content that should NOT be contained in matched nodes
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $match content that should NOT be contained in matched nodes
+ * @param string $message
*/
public function assertNotXpathContentContains($path, $match, $message = '')
{
@@ -563,10 +531,9 @@
/**
* Assert against XPath selection; node should match content
*
- * @param string $path XPath path
- * @param string $pattern Pattern that should be contained in matched nodes
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $pattern Pattern that should be contained in matched nodes
+ * @param string $message
*/
public function assertXpathContentRegex($path, $pattern, $message = '')
{
@@ -583,10 +550,9 @@
/**
* Assert against XPath selection; node should NOT match content
*
- * @param string $path XPath path
- * @param string $pattern pattern that should NOT be contained in matched nodes
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $pattern pattern that should NOT be contained in matched nodes
+ * @param string $message
*/
public function assertNotXpathContentRegex($path, $pattern, $message = '')
{
@@ -603,10 +569,9 @@
/**
* Assert against XPath selection; should contain exact number of nodes
*
- * @param string $path XPath path
- * @param string $count Number of nodes that should match
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $count Number of nodes that should match
+ * @param string $message
*/
public function assertXpathCount($path, $count, $message = '')
{
@@ -623,10 +588,9 @@
/**
* Assert against XPath selection; should NOT contain exact number of nodes
*
- * @param string $path XPath path
- * @param string $count Number of nodes that should NOT match
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $count Number of nodes that should NOT match
+ * @param string $message
*/
public function assertNotXpathCount($path, $count, $message = '')
{
@@ -643,10 +607,9 @@
/**
* Assert against XPath selection; should contain at least this number of nodes
*
- * @param string $path XPath path
- * @param string $count Minimum number of nodes that should match
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $count Minimum number of nodes that should match
+ * @param string $message
*/
public function assertXpathCountMin($path, $count, $message = '')
{
@@ -663,10 +626,9 @@
/**
* Assert against XPath selection; should contain no more than this number of nodes
*
- * @param string $path XPath path
- * @param string $count Maximum number of nodes that should match
- * @param string $message
- * @return void
+ * @param string $path XPath path
+ * @param string $count Maximum number of nodes that should match
+ * @param string $message
*/
public function assertXpathCountMax($path, $count, $message = '')
{
@@ -683,8 +645,7 @@
/**
* Assert that response is a redirect
*
- * @param string $message
- * @return void
+ * @param string $message
*/
public function assertRedirect($message = '')
{
@@ -700,8 +661,7 @@
/**
* Assert that response is NOT a redirect
*
- * @param string $message
- * @return void
+ * @param string $message
*/
public function assertNotRedirect($message = '')
{
@@ -717,9 +677,8 @@
/**
* Assert that response redirects to given URL
*
- * @param string $url
- * @param string $message
- * @return void
+ * @param string $url
+ * @param string $message
*/
public function assertRedirectTo($url, $message = '')
{
@@ -735,9 +694,8 @@
/**
* Assert that response does not redirect to given URL
*
- * @param string $url
- * @param string $message
- * @return void
+ * @param string $url
+ * @param string $message
*/
public function assertNotRedirectTo($url, $message = '')
{
@@ -753,9 +711,8 @@
/**
* Assert that redirect location matches pattern
*
- * @param string $pattern
- * @param string $message
- * @return void
+ * @param string $pattern
+ * @param string $message
*/
public function assertRedirectRegex($pattern, $message = '')
{
@@ -771,9 +728,8 @@
/**
* Assert that redirect location does not match pattern
*
- * @param string $pattern
- * @param string $message
- * @return void
+ * @param string $pattern
+ * @param string $message
*/
public function assertNotRedirectRegex($pattern, $message = '')
{
@@ -789,9 +745,8 @@
/**
* Assert response code
*
- * @param int $code
- * @param string $message
- * @return void
+ * @param int $code
+ * @param string $message
*/
public function assertResponseCode($code, $message = '')
{
@@ -807,9 +762,8 @@
/**
* Assert response code
*
- * @param int $code
- * @param string $message
- * @return void
+ * @param int $code
+ * @param string $message
*/
public function assertNotResponseCode($code, $message = '')
{
@@ -826,9 +780,8 @@
/**
* Assert response header exists
*
- * @param string $header
- * @param string $message
- * @return void
+ * @param string $header
+ * @param string $message
*/
public function assertHeader($header, $message = '')
{
@@ -844,9 +797,8 @@
/**
* Assert response header does not exist
*
- * @param string $header
- * @param string $message
- * @return void
+ * @param string $header
+ * @param string $message
*/
public function assertNotHeader($header, $message = '')
{
@@ -863,10 +815,9 @@
/**
* Assert response header exists and contains the given string
*
- * @param string $header
- * @param string $match
- * @param string $message
- * @return void
+ * @param string $header
+ * @param string $match
+ * @param string $message
*/
public function assertHeaderContains($header, $match, $message = '')
{
@@ -882,10 +833,9 @@
/**
* Assert response header does not exist and/or does not contain the given string
*
- * @param string $header
- * @param string $match
- * @param string $message
- * @return void
+ * @param string $header
+ * @param string $match
+ * @param string $message
*/
public function assertNotHeaderContains($header, $match, $message = '')
{
@@ -902,10 +852,9 @@
/**
* Assert response header exists and matches the given pattern
*
- * @param string $header
- * @param string $pattern
- * @param string $message
- * @return void
+ * @param string $header
+ * @param string $pattern
+ * @param string $message
*/
public function assertHeaderRegex($header, $pattern, $message = '')
{
@@ -921,10 +870,9 @@
/**
* Assert response header does not exist and/or does not match the given regex
*
- * @param string $header
- * @param string $pattern
- * @param string $message
- * @return void
+ * @param string $header
+ * @param string $pattern
+ * @param string $message
*/
public function assertNotHeaderRegex($header, $pattern, $message = '')
{
@@ -941,9 +889,8 @@
/**
* Assert that the last handled request used the given module
*
- * @param string $module
- * @param string $message
- * @return void
+ * @param string $module
+ * @param string $message
*/
public function assertModule($module, $message = '')
{
@@ -963,9 +910,8 @@
/**
* Assert that the last handled request did NOT use the given module
*
- * @param string $module
- * @param string $message
- * @return void
+ * @param string $module
+ * @param string $message
*/
public function assertNotModule($module, $message = '')
{
@@ -982,9 +928,8 @@
/**
* Assert that the last handled request used the given controller
*
- * @param string $controller
- * @param string $message
- * @return void
+ * @param string $controller
+ * @param string $message
*/
public function assertController($controller, $message = '')
{
@@ -1006,7 +951,6 @@
*
* @param string $controller
* @param string $message
- * @return void
*/
public function assertNotController($controller, $message = '')
{
@@ -1026,9 +970,8 @@
/**
* Assert that the last handled request used the given action
*
- * @param string $action
- * @param string $message
- * @return void
+ * @param string $action
+ * @param string $message
*/
public function assertAction($action, $message = '')
{
@@ -1045,9 +988,8 @@
/**
* Assert that the last handled request did NOT use the given action
*
- * @param string $action
- * @param string $message
- * @return void
+ * @param string $action
+ * @param string $message
*/
public function assertNotAction($action, $message = '')
{
@@ -1064,9 +1006,8 @@
/**
* Assert that the specified route was used
*
- * @param string $route
- * @param string $message
- * @return void
+ * @param string $route
+ * @param string $message
*/
public function assertRoute($route, $message = '')
{
@@ -1087,9 +1028,8 @@
/**
* Assert that the route matched is NOT as specified
*
- * @param string $route
- * @param string $message
- * @return void
+ * @param string $route
+ * @param string $message
*/
public function assertNotRoute($route, $message = '')
{
@@ -1158,14 +1098,17 @@
}
return $this->_query;
}
-
+
/**
* URL Helper
- *
- * @param array $urlOptions
- * @param string $name
- * @param bool $reset
- * @param bool $encode
+ *
+ * @param array $urlOptions
+ * @param string $name
+ * @param bool $reset
+ * @param bool $encode
+ * @throws Exception
+ * @throws Zend_Controller_Router_Exception
+ * @return string
*/
public function url($urlOptions = array(), $name = null, $reset = false, $encode = true)
{
@@ -1179,7 +1122,14 @@
}
return $router->assemble($urlOptions, $name, $reset, $encode);
}
-
+
+ /**
+ * Urlize options
+ *
+ * @param array $urlOptions
+ * @param bool $actionControllerModuleOnly
+ * @return mixed
+ */
public function urlizeOptions($urlOptions, $actionControllerModuleOnly = true)
{
$ccToDash = new Zend_Filter_Word_CamelCaseToDash();
@@ -1193,13 +1143,11 @@
/**
* Increment assertion count
- *
- * @return void
*/
protected function _incrementAssertionCount()
{
$stack = debug_backtrace();
- foreach (debug_backtrace() as $step) {
+ foreach ($stack as $step) {
if (isset($step['object'])
&& $step['object'] instanceof PHPUnit_Framework_TestCase
) {