From 02072de7e65560b4d8d75ee918bf85c38baa2dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Thu, 27 Nov 2014 18:07:55 +0100 Subject: [PATCH] Fixes DocBlocks in Zend_Test_PHPUnit --- .../Zend/Test/PHPUnit/ControllerTestCase.php | 289 ++++++++---------- .../PHPUnit/Db/DataSet/DbTableDataSet.php | 1 - .../Test/PHPUnit/Db/DataSet/QueryTable.php | 5 +- .../Zend/Test/PHPUnit/Db/Metadata/Generic.php | 2 +- 4 files changed, 127 insertions(+), 170 deletions(-) diff --git a/library/Zend/Test/PHPUnit/ControllerTestCase.php b/library/Zend/Test/PHPUnit/ControllerTestCase.php index bb54d20184..819fb222a7 100644 --- a/library/Zend/Test/PHPUnit/ControllerTestCase.php +++ b/library/Zend/Test/PHPUnit/ControllerTestCase.php @@ -81,8 +81,8 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te * 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) { @@ -98,8 +98,8 @@ public function __set($name, $value) * * 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) { @@ -119,8 +119,6 @@ public function __get($name) * Set up MVC app * * Calls {@link bootstrap()} by default - * - * @return void */ protected function setUp() { @@ -135,8 +133,6 @@ protected function setUp() * 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() { @@ -167,8 +163,7 @@ final public function bootstrap() * 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) { @@ -207,7 +202,6 @@ public function dispatch($url = null) * instance, and resets the action helper broker. * * @todo Need to update Zend_Layout to add a resetInstance() method - * @return void */ public function reset() { @@ -225,8 +219,6 @@ public function reset() /** * Rest all view placeholders - * - * @return void */ protected function _resetPlaceholders() { @@ -277,9 +269,8 @@ public function resetResponse() /** * 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 = '') { @@ -295,9 +286,8 @@ public function assertQuery($path, $message = '') /** * 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 = '') { @@ -313,10 +303,9 @@ public function assertNotQuery($path, $message = '') /** * 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 = '') { @@ -332,10 +321,9 @@ public function assertQueryContentContains($path, $match, $message = '') /** * 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 = '') { @@ -351,10 +339,9 @@ public function assertNotQueryContentContains($path, $match, $message = '') /** * 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 = '') { @@ -370,10 +357,9 @@ public function assertQueryContentRegex($path, $pattern, $message = '') /** * 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 = '') { @@ -389,10 +375,9 @@ public function assertNotQueryContentRegex($path, $pattern, $message = '') /** * 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 = '') { @@ -408,10 +393,9 @@ public function assertQueryCount($path, $count, $message = '') /** * 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 = '') { @@ -427,10 +411,9 @@ public function assertNotQueryCount($path, $count, $message = '') /** * 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 = '') { @@ -446,10 +429,9 @@ public function assertQueryCountMin($path, $count, $message = '') /** * 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 = '') { @@ -465,8 +447,7 @@ public function assertQueryCountMax($path, $count, $message = '') /** * Register XPath namespaces * - * @param array $xpathNamespaces - * @return void + * @param array $xpathNamespaces */ public function registerXpathNamespaces($xpathNamespaces) { @@ -476,9 +457,8 @@ public function registerXpathNamespaces($xpathNamespaces) /** * 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 = '') { @@ -495,9 +475,8 @@ public function assertXpath($path, $message = '') /** * 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 = '') { @@ -514,10 +493,9 @@ public function assertNotXpath($path, $message = '') /** * 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 = '') { @@ -534,10 +512,9 @@ public function assertXpathContentContains($path, $match, $message = '') /** * 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 = '') { @@ -554,10 +531,9 @@ public function assertNotXpathContentContains($path, $match, $message = '') /** * 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 = '') { @@ -574,10 +550,9 @@ public function assertXpathContentRegex($path, $pattern, $message = '') /** * 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 = '') { @@ -594,10 +569,9 @@ public function assertNotXpathContentRegex($path, $pattern, $message = '') /** * 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 = '') { @@ -614,10 +588,9 @@ public function assertXpathCount($path, $count, $message = '') /** * 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 = '') { @@ -634,10 +607,9 @@ public function assertNotXpathCount($path, $count, $message = '') /** * 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 = '') { @@ -654,10 +626,9 @@ public function assertXpathCountMin($path, $count, $message = '') /** * 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 = '') { @@ -674,8 +645,7 @@ public function assertXpathCountMax($path, $count, $message = '') /** * Assert that response is a redirect * - * @param string $message - * @return void + * @param string $message */ public function assertRedirect($message = '') { @@ -691,8 +661,7 @@ public function assertRedirect($message = '') /** * Assert that response is NOT a redirect * - * @param string $message - * @return void + * @param string $message */ public function assertNotRedirect($message = '') { @@ -708,9 +677,8 @@ public function assertNotRedirect($message = '') /** * 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 = '') { @@ -726,9 +694,8 @@ public function assertRedirectTo($url, $message = '') /** * 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 = '') { @@ -744,9 +711,8 @@ public function assertNotRedirectTo($url, $message = '') /** * 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 = '') { @@ -762,9 +728,8 @@ public function assertRedirectRegex($pattern, $message = '') /** * 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 = '') { @@ -780,9 +745,8 @@ public function assertNotRedirectRegex($pattern, $message = '') /** * Assert response code * - * @param int $code - * @param string $message - * @return void + * @param int $code + * @param string $message */ public function assertResponseCode($code, $message = '') { @@ -798,9 +762,8 @@ public function assertResponseCode($code, $message = '') /** * Assert response code * - * @param int $code - * @param string $message - * @return void + * @param int $code + * @param string $message */ public function assertNotResponseCode($code, $message = '') { @@ -817,9 +780,8 @@ public function assertNotResponseCode($code, $message = '') /** * Assert response header exists * - * @param string $header - * @param string $message - * @return void + * @param string $header + * @param string $message */ public function assertHeader($header, $message = '') { @@ -835,9 +797,8 @@ public function assertHeader($header, $message = '') /** * 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 = '') { @@ -854,10 +815,9 @@ public function assertNotHeader($header, $message = '') /** * 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 = '') { @@ -873,10 +833,9 @@ public function assertHeaderContains($header, $match, $message = '') /** * 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 = '') { @@ -893,10 +852,9 @@ public function assertNotHeaderContains($header, $match, $message = '') /** * 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 = '') { @@ -912,10 +870,9 @@ public function assertHeaderRegex($header, $pattern, $message = '') /** * 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 = '') { @@ -932,9 +889,8 @@ public function assertNotHeaderRegex($header, $pattern, $message = '') /** * 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 = '') { @@ -954,9 +910,8 @@ public function assertModule($module, $message = '') /** * 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 = '') { @@ -973,9 +928,8 @@ public function assertNotModule($module, $message = '') /** * 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 = '') { @@ -997,7 +951,6 @@ public function assertController($controller, $message = '') * * @param string $controller * @param string $message - * @return void */ public function assertNotController($controller, $message = '') { @@ -1017,9 +970,8 @@ public function assertNotController($controller, $message = '') /** * 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 = '') { @@ -1036,9 +988,8 @@ public function assertAction($action, $message = '') /** * 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 = '') { @@ -1055,9 +1006,8 @@ public function assertNotAction($action, $message = '') /** * 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 = '') { @@ -1078,9 +1028,8 @@ public function assertRoute($route, $message = '') /** * 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 = '') { @@ -1149,14 +1098,17 @@ public function getQuery() } 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) { @@ -1170,7 +1122,14 @@ public function url($urlOptions = array(), $name = null, $reset = false, $encode } 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(); @@ -1184,8 +1143,6 @@ public function urlizeOptions($urlOptions, $actionControllerModuleOnly = true) /** * Increment assertion count - * - * @return void */ protected function _incrementAssertionCount() { diff --git a/library/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php b/library/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php index 3d113f259a..9cd0702af7 100644 --- a/library/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php +++ b/library/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php @@ -48,7 +48,6 @@ class Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet extends PHPUnit_Extensions_Dat * By default a select * will be done on the given tablename. * * @param Zend_Db_Table_Abstract $table - * @param string|Zend_Db_Select $query * @param string $where * @param string $order * @param string $count diff --git a/library/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php b/library/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php index 32722db1ab..dbcba063a1 100644 --- a/library/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php +++ b/library/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php @@ -35,9 +35,10 @@ class Zend_Test_PHPUnit_Db_DataSet_QueryTable extends PHPUnit_Extensions_Databas /** * Creates a new database query table object. * - * @param string $table_name - * @param string $query + * @param string $tableName + * @param string $query * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection + * @throws Zend_Test_PHPUnit_Db_Exception */ public function __construct($tableName, $query, PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection) { diff --git a/library/Zend/Test/PHPUnit/Db/Metadata/Generic.php b/library/Zend/Test/PHPUnit/Db/Metadata/Generic.php index f6c63ba517..c992a8cc4e 100644 --- a/library/Zend/Test/PHPUnit/Db/Metadata/Generic.php +++ b/library/Zend/Test/PHPUnit/Db/Metadata/Generic.php @@ -62,7 +62,7 @@ class Zend_Test_PHPUnit_Db_Metadata_Generic implements PHPUnit_Extensions_Databa * Creates a new database meta data object using the given pdo connection * and schema name. * - * @param PDO $pdo + * @param Zend_Db_Adapter_Abstract $db * @param string $schema */ public final function __construct(Zend_Db_Adapter_Abstract $db, $schema)