This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

A bit of code sniffer cleanup on the test tree.

  • Loading branch information...
LouisLandry committed Oct 8, 2012
1 parent dd45eae commit f210190210cd5da975d4bee4f95e68c3d366922c
@@ -5,11 +5,11 @@
* Joomla is assumed to include the /unittest/ directory.
* eg, /path/to/joomla/unittest/
*
- * @package Joomla.UnitTest
+ * @package Joomla.UnitTest
*
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE
- * @link http://www.phpunit.de/manual/current/en/installation.html
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ * @link http://www.phpunit.de/manual/current/en/installation.html
*/
define('_JEXEC', 1);
View
@@ -5,11 +5,11 @@
* Joomla is assumed to include the /unittest/ directory.
* eg, /path/to/joomla/unittest/
*
- * @package Joomla.UnitTest
+ * @package Joomla.UnitTest
*
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE
- * @link http://www.phpunit.de/manual/current/en/installation.html
+ * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE
+ * @link http://www.phpunit.de/manual/current/en/installation.html
*/
define('_JEXEC', 1);
View
@@ -46,7 +46,7 @@
/**
* Receives the callback from JError and logs the required error information for the test.
*
- * @param JException $error The JException object from JError
+ * @param JException $error The JException object from JError
*
* @return boolean To not continue with JError processing
*
@@ -116,7 +116,7 @@ public function assignMockReturns($mockObject, $array)
* If a test expects a JError to be raised, it should call this setExpectedError first
* If you don't call this method first, the test will fail.
*
- * @param JException $error
+ * @param JException $error The JException object from JError
*
* @return JException
*
@@ -288,7 +288,7 @@ class_exists('JApplicationWeb');
*
* If passed without argument, the array is initialized if it hsn't been already
*
- * @param mixed $error
+ * @param mixed $error The JException object to expect.
*
* @return void
*
@@ -422,8 +422,9 @@ protected function setErrorHandlers($errorHandlers)
}
/**
- * Sets the JError error handlers to callback mode and points them at the test
- * logging method.
+ * Sets the JError error handlers to callback mode and points them at the test logging method.
+ *
+ * @param string $testName The name of the test class for which to set the error callback method.
*
* @return void
*
@@ -56,7 +56,7 @@
/**
* Receives the callback from JError and logs the required error information for the test.
*
- * @param JException The JException object from JError
+ * @param JException $error The JException object from JError
*
* @return bool To not continue with JError processing
*
@@ -459,8 +459,9 @@ protected function setErrorHandlers($errorHandlers)
}
/**
- * Sets the JError error handlers to callback mode and points them at the test
- * logging method.
+ * Sets the JError error handlers to callback mode and points them at the test logging method.
+ *
+ * @param string $testName The name of the test class for which to set the error callback method.
*
* @return void
*
View
@@ -68,11 +68,11 @@ public static function create(TestCase $test, $data = array())
/**
* Callback for the cache get method.
*
- * @param string $id The name of the cache key to retrieve.
+ * @param string $id The name of the cache key to retrieve.
*
- * @return mixed The value of the key or null if it does not exist.
+ * @return mixed The value of the key or null if it does not exist.
*
- * @since 12.1
+ * @since 12.1
*/
public function mockGet($id)
{
@@ -82,12 +82,12 @@ public function mockGet($id)
/**
* Callback for the cache get method.
*
- * @param string $key The name of the cache key.
- * @param string $group Dummy group.
+ * @param string $value The value to store.
+ * @param string $id The name of the cache key.
*
- * @return mixed The value of the key or null if it does not exist.
+ * @return mixed The value of the key or null if it does not exist.
*
- * @since 12.1
+ * @since 12.1
*/
public function mockStore($value, $id)
{
@@ -25,7 +25,9 @@ class TestMockDatabaseDriver
/**
* Creates and instance of the mock JDatabase object.
*
- * @param object $test A test object.
+ * @param object $test A test object.
+ * @param string $nullDate A null date string for the driver.
+ * @param string $dateFormat A date format for the driver.
*
* @return object
*
@@ -128,11 +130,11 @@ public static function create($test, $nullDate = '0000-00-00 00:00:00', $dateFor
/**
* Callback for the dbo setQuery method.
*
- * @param string $new True to get a new query, false to get the last query.
+ * @param boolean $new True to get a new query, false to get the last query.
*
- * @return void
+ * @return void
*
- * @since 11.3
+ * @since 11.3
*/
public function mockGetQuery($new = false)
{
@@ -149,11 +151,11 @@ public function mockGetQuery($new = false)
/**
* Mocking the quote method.
*
- * @param string $value The value to be quoted.
+ * @param string $value The value to be quoted.
*
- * @return string The value passed wrapped in MySQL quotes.
+ * @return string The value passed wrapped in MySQL quotes.
*
- * @since 11.3
+ * @since 11.3
*/
public function mockQuote($value)
{
@@ -163,11 +165,11 @@ public function mockQuote($value)
/**
* Mock quoteName method.
*
- * @param string $value The value to be quoted.
+ * @param string $value The value to be quoted.
*
- * @return string The value passed wrapped in MySQL quotes.
+ * @return string The value passed wrapped in MySQL quotes.
*
- * @since 11.3
+ * @since 11.3
*/
public function mockQuoteName($value)
{
@@ -177,11 +179,11 @@ public function mockQuoteName($value)
/**
* Callback for the dbo setQuery method.
*
- * @param string $query The query.
+ * @param string $query The query.
*
- * @return void
+ * @return void
*
- * @since 11.3
+ * @since 11.3
*/
public function mockSetQuery($query)
{
@@ -33,7 +33,8 @@ class TestMockDispatcher
/**
* Creates and instance of the mock JLanguage object.
*
- * @param object $test A test object.
+ * @param object $test A test object.
+ * @param boolean $defaults True to create the default mock handlers and triggers.
*
* @return object
*
@@ -17,7 +17,7 @@ class TestMockDocument
/**
* Creates and instance of the mock JLanguage object.
*
- * @param object $test A test object.
+ * @param object $test A test object.
*
* @return object
*
@@ -17,7 +17,7 @@ class TestMockLanguage
/**
* Creates and instance of the mock JLanguage object.
*
- * @param object $test A test object.
+ * @param object $test A test object.
*
* @return object
*
@@ -17,7 +17,7 @@ class TestMockRules
/**
* Creates an instance of the mock JDatabase object.
*
- * @param object $test A test object.
+ * @param object $test A test object.
*
* @return object
*
@@ -55,7 +55,8 @@ public static function create($test)
/**
* Mocking the allow method.
*
- * @param string $action The action.
+ * @param string $action The action.
+ * @param integer $identity The identity ID.
*
* @return mixed Boolean or null.
*
@@ -17,8 +17,8 @@ class TestReflection
/**
* Helper method that gets a protected or private property in a class by relfection.
*
- * @param object $object
- * @param string $propertyName
+ * @param object $object The object from which to return the property value.
+ * @param string $propertyName The name of the property to return.
*
* @return mixed The value of the property.
*
@@ -57,8 +57,8 @@ public static function getValue($object, $propertyName)
*
* $this->asserTrue(TestCase::invoke('methodName', $this->object, 123));
*
- * @param object $object
- * @param string $methodName
+ * @param object $object The object on which to invoke the method.
+ * @param string $methodName The name of the method to invoke.
*
* @return mixed
*
@@ -84,9 +84,9 @@ public static function invoke($object, $methodName)
/**
* Helper method that sets a protected or private property in a class by relfection.
*
- * @param object $object
- * @param string $propertyName
- * @param mixed $value
+ * @param object $object The object for which to set the property.
+ * @param string $propertyName The name of the property to set.
+ * @param mixed $value The value to set for the property.
*
* @return void
*
@@ -105,7 +105,7 @@ public static function setValue($object, $propertyName, $value)
$property->setValue($object, $value);
}
// Hrm, maybe dealing with a private property in the parent class.
- else if (get_parent_class($object))
+ elseif (get_parent_class($object))
{
$property = new \ReflectionProperty(get_parent_class($object), $propertyName);
$property->setAccessible(true);
Oops, something went wrong.

0 comments on commit f210190

Please sign in to comment.