Browse Source

cs via autocorrection and cleanup

euromark 12 years ago
parent
commit
a1be15a7a6

+ 1 - 0
Controller/Component/CommonComponent.php

@@ -136,6 +136,7 @@ class CommonComponent extends Component {
 	}
 
 	//deprecated - use isPosted instead
+
 	public function isPost() {
 		trigger_error('deprecated - use isPosted()');
 		return $this->isPosted();

+ 1 - 0
Lib/CurlLib.php

@@ -99,6 +99,7 @@ class CurlLib {
 	}
 
 	//TODO: use Dummy.FakerLib instead
+
 	public function randomizeUserAgent() {
 		//list of browsers
 		$agentBrowser = array(

+ 1 - 0
Lib/Utility/TextAnalysisLib.php

@@ -213,6 +213,7 @@ class TextAnalysisLib extends TextLib {
 	}
 
 	//TODO: improve it to work with case insensitivity and utf8 chars like é or î
+
 	public function getWord($parse = false) {
 		if (!$this->word && !$this->rWord) {
 			@preg_match_all("/[A-Za-zäöüÄÖÜß\-'\\\"]+/", $this->text, $m);

+ 1 - 0
Lib/WeatherLib.php

@@ -79,6 +79,7 @@ class WeatherLib {
 	}
 
 	//.../feed/weather.ashx?q=Neufahrn&format=json&num_of_days=2&key=598dfbdaeb121715111208
+
 	public function _get($url, $options) {
 		if (isset($options['cache'])) {
 			$cache = $options['cache'];

+ 1 - 0
Model/Behavior/CustomFindsBehavior.php

@@ -53,6 +53,7 @@ class CustomFindsBehavior extends ModelBehavior {
 	}
 
 	//TODO: fixme for deeper arrays
+
 	protected function _remove(&$query, $removes) {
 		foreach ($removes as $key => $remove) {
 			//$query = Set::remove($query, $remove); # doesnt work due to dot syntax

+ 1 - 0
Test/Case/Lib/GeocodeLibTest.php

@@ -80,6 +80,7 @@ class GeocodeLibTest extends MyCakeTestCase {
 	}
 
 	// not possible with protected method
+
 	public function _testFetch() {
 		$url = 'http://maps.google.com/maps/api/geocode/xml?sensor=false&address=74523';
 		$is = $this->Geocode->_fetch($url);

+ 1 - 0
Test/Case/Lib/GooglLibTest.php

@@ -21,6 +21,7 @@ class GooglLibTest extends CakeTestCase {
 	}
 
 	//TODO
+
 	public function testOAuth() {
 	}
 

+ 1 - 0
Test/Case/Lib/Utility/UtilityTest.php

@@ -274,6 +274,7 @@ class UtilityTest extends MyCakeTestCase {
 	}
 
 	//TODO: move to boostrap
+
 	public function _testDeepFunction() {
 		$is = array(
 			'f some',

+ 2 - 0
Test/Case/Model/MyModelTest.php

@@ -348,6 +348,7 @@ class MyModelTest extends MyCakeTestCase {
 	}
 
 	// not really working?
+
 	public function testBlacklist() {
 		$this->out($this->_header(__FUNCTION__), true);
 		$data = array($this->modelName => array('name' => 'e', 'x' => 'hey'), 'OtherModel' => array('y' => ''));
@@ -722,6 +723,7 @@ class AppTestModel extends MyModel {
 			'length' => 10,
 		),
 	);
+
 	public static function x() {
 		return array('1' => 'x', '2' => 'y', '3' => 'z');
 	}

+ 1 - 0
Test/Case/View/Helper/DatetimeHelperTest.php

@@ -67,6 +67,7 @@ class DatetimeHelperTest extends MyCakeTestCase {
 	}
 
 	// Cake internal function...
+
 	public function testTimeAgoInWords() {
 		//echo $this->_header(__FUNCTION__);
 

+ 1 - 0
Test/Case/View/Helper/FormExtHelperTest.php

@@ -57,6 +57,7 @@ class FormExtHelperTest extends MyCakeTestCase {
 	}
 
 	//Not needed right now as autoRequire has been disabled
+
 	public function _testAutoRequire() {
 		$this->Form->request->data['ContactExt']['id'] = 1;
 		$this->Form->create('ContactExt');

+ 1 - 0
Test/Case/View/Helper/TreeHelperTest.php

@@ -102,6 +102,7 @@ TEXT;
 	}
 
 	//TODO: beautify debug output
+
 	public function testGenerateWithFindAll() {
 		$tree = $this->Model->find('all', array('order' => array('lft' => 'ASC')));
 

+ 27 - 56
TestSuite/MyCakeTestCase.php

@@ -2,68 +2,21 @@
 
 abstract class MyCakeTestCase extends CakeTestCase {
 
-/*** assert mods ***/
-
-/** enhanced **/
-
+	/**
+	 * Opposite wrapper method of assertWithinMargin.
+	 *
+	 * @param float $result
+	 * @param float $expected
+	 * @param float $margin
+	 * @param string $message
+	 * @return void
+	 */
 	protected static function assertNotWithinMargin($result, $expected, $margin, $message = '') {
 		$upper = $result + $margin;
 		$lower = $result - $margin;
 		return self::assertFalse((($expected <= $upper) && ($expected >= $lower)), $message);
 	}
 
-	//deprecated?
-	public function assertIsNull($is, $title = null, $value = null, $message = '', $options = array()) {
-		$expectation = 'NULL';
-		self::_printTitle($expectation, $title, $options);
-		self::_printResult($is, $value, $options);
-		return $this->assertNull($is, $message);
-	}
-
-	//deprecated?
-	public function assertIsNotNull($is, $title = null, $value = null, $message = '', $options = array()) {
-		$expectation = 'NOT NULL';
-		self::_printTitle($expectation, $title, $options);
-		self::_printResult($is, $value, $options);
-		return $this->assertNotNull($is, $message);
-	}
-
-/*** time needed ***/
-
-	protected static $startTime = null;
-
-	protected function _microtime($precision = 8) {
-		return round(microtime(true), $precision);
-	}
-
-	protected function _startClock($precision = 8) {
-		self::$startTime = self::_microtime();
-	}
-
-	protected function _elapsedTime($precision = 8, $restart = false) {
-		$elapsed = self::_microtime() - self::$startTime;
-		if ($restart) {
-			self::_startClock();
-		}
-		return round($elapsed, $precision);
-	}
-
-/*
-# cakephp2 phpunit wrapper
-	public function assertEquals($expected, $actual, $title = null, $value = null, $message = '', $options = array()) {
-		return $this->assertEqual($expected, $actual, $title, $value, $message, $options);
-	}
-
-	public function assertInternalType($expected, $actual) {
-		return $this->assertType($expected, $actual);
-	}
-
-	public function markTestIncomplete() {
-		$this->skipIf(true, '%s - Test Incomplete');
-		return;
-	}
-*/
-
 /*** Helper Functions **/
 
 	/**
@@ -139,6 +92,24 @@ abstract class MyCakeTestCase extends CakeTestCase {
 		return current(split("webroot", $_SERVER['PHP_SELF']));
 	}
 
+	protected static $_startTime = null;
+
+	protected function _microtime($precision = 8) {
+		return round(microtime(true), $precision);
+	}
+
+	protected function _startClock($precision = 8) {
+		self::$_startTime = self::_microtime();
+	}
+
+	protected function _elapsedTime($precision = 8, $restart = false) {
+		$elapsed = self::_microtime() - self::$_startTime;
+		if ($restart) {
+			self::_startClock();
+		}
+		return round($elapsed, $precision);
+	}
+
 	/**
 	 * @param float $time
 	 * @param integer precision

+ 3 - 2
View/Helper/FormatHelper.php

@@ -398,7 +398,7 @@ class FormatHelper extends TextHelper {
 	 * - title, alt, ...
 	 * THE REST IS DEPRECATED
 	 */
-	public function cIcon($icon, $t=null, $a=null, $translate=true, $options=array()) {
+	public function cIcon($icon, $t = null, $a = null, $translate = true, $options = array()) {
 		if (is_array($t)) {
 			$translate = isset($t['translate']) ? $t['translate'] : true;
 			$options = (array)$a;
@@ -638,7 +638,7 @@ class FormatHelper extends TextHelper {
 	 *
 	 * @todo $on=1, $text=false, $ontitle=false,... => in array(OPTIONS) packen
 	 */
-	public function yesNo($v, $ontitle = null, $offtitle = null, $on = 1, $text=false, $notitle=false) {
+	public function yesNo($v, $ontitle = null, $offtitle = null, $on = 1, $text = false, $notitle = false) {
 		$ontitle = (!empty($ontitle) ? $ontitle : __('Ja'));
 		$offtitle = (!empty($offtitle) ? $offtitle : __('Nein'));
 		$sbez = array('0' => @substr($offtitle, 0, 1), '1' => @substr($ontitle, 0, 1));
@@ -1084,6 +1084,7 @@ class FormatHelper extends TextHelper {
 	}
 
 	//deprecated?
+
 	public function avatar($setting, $uid, $email = null, $options = array()) {
 
 		$options = array_merge(array('title' => __('Avatar')), $options);

+ 1 - 1
View/Helper/TextExtHelper.php

@@ -139,7 +139,7 @@ class TextExtHelper extends TextHelper {
 	 * @param array params: ?subject=y&body=y to be attached to "mailto:xyz"
 	 * @return string html with js generated link around email (and non js fallback)
 	 */
-	public function encodeEmailUrl($mail, $text=null, $params=array(), $attr = array()) {
+	public function encodeEmailUrl($mail, $text = null, $params = array(), $attr = array()) {
 		if (empty($class)) {
 			$class = 'email';
 		}