dereuromark 8 years ago
parent
commit
b19a61050e
35 changed files with 276 additions and 24 deletions
  1. 12 0
      src/Form/ContactForm.php
  2. 1 1
      src/Mailer/Email.php
  3. 1 1
      src/Model/Behavior/PasswordableBehavior.php
  4. 4 0
      src/Model/Behavior/SluggedBehavior.php
  5. 2 2
      src/Model/Table/Table.php
  6. 4 5
      src/Utility/Random.php
  7. 5 0
      src/Utility/Text.php
  8. 3 0
      src/View/Helper/QrCodeHelper.php
  9. 29 0
      tests/TestApp/Model/Table/ResetCommentsTable.php
  10. 9 0
      tests/TestCase/BootstrapTest.php
  11. 36 0
      tests/TestCase/Controller/Component/MobileComponentTest.php
  12. 3 0
      tests/TestCase/HtmlDom/HtmlDomTest.php
  13. 3 0
      tests/TestCase/Mailer/EmailTest.php
  14. 3 0
      tests/TestCase/Model/Behavior/JsonableBehaviorTest.php
  15. 3 0
      tests/TestCase/Model/Behavior/PasswordableBehaviorTest.php
  16. 6 0
      tests/TestCase/Model/Behavior/ResetBehaviorTest.php
  17. 3 0
      tests/TestCase/Model/Behavior/StringBehaviorTest.php
  18. 3 0
      tests/TestCase/Model/Table/TableTest.php
  19. 15 0
      tests/TestCase/Model/Table/TokensTableTest.php
  20. 6 0
      tests/TestCase/TestSuite/IntegrationTestCaseTest.php
  21. 6 0
      tests/TestCase/TestSuite/TestCaseTest.php
  22. 6 0
      tests/TestCase/TestSuite/ToolsTestTraitTest.php
  23. 3 0
      tests/TestCase/Utility/LanguageTest.php
  24. 28 11
      tests/TestCase/Utility/MimeTest.php
  25. 3 0
      tests/TestCase/Utility/NumberTest.php
  26. 12 0
      tests/TestCase/Utility/RandomTest.php
  27. 18 0
      tests/TestCase/Utility/TextTest.php
  28. 12 0
      tests/TestCase/Utility/TimeTest.php
  29. 3 0
      tests/TestCase/View/Helper/FormatHelperTest.php
  30. 3 0
      tests/TestCase/View/Helper/HtmlHelperTest.php
  31. 6 0
      tests/TestCase/View/Helper/NumberHelperTest.php
  32. 3 0
      tests/TestCase/View/Helper/TextHelperTest.php
  33. 3 0
      tests/TestCase/View/Helper/TimeHelperTest.php
  34. 3 0
      tests/TestCase/View/Helper/TimelineHelperTest.php
  35. 16 4
      tests/TestCase/View/Helper/TreeHelperTest.php

+ 12 - 0
src/Form/ContactForm.php

@@ -15,6 +15,10 @@ use Cake\Validation\Validator;
  */
 class ContactForm extends Form {
 
+	/**
+	 * @param \Cake\Form\Schema $schema
+	 * @return \Cake\Form\Schema
+	 */
 	protected function _buildSchema(Schema $schema) {
 		return $schema->addField('name', ['type' => 'string', 'length' => 40])
 			->addField('email', ['type' => 'string', 'length' => 50])
@@ -22,6 +26,10 @@ class ContactForm extends Form {
 			->addField('body', ['type' => 'text']);
 	}
 
+	/**
+	 * @param \Cake\Validation\Validator $validator
+	 * @return \Cake\Validation\Validator
+	 */
 	protected function _buildValidator(Validator $validator) {
 		return $validator
 			->requirePresence('name')
@@ -37,6 +45,10 @@ class ContactForm extends Form {
 			->notEmpty('message', __('This field cannot be left empty'));
 	}
 
+	/**
+	 * @param array $data
+	 * @return bool
+	 */
 	protected function _execute(array $data) {
 		// Overwrite in your extending class
 		return true;

+ 1 - 1
src/Mailer/Email.php

@@ -564,7 +564,7 @@ class Email extends CakeEmail {
 			'transport' => get_class($this->_transport),
 		];
 
-		/* @deprecated Since CakePHP 3.4.0-RC4 in core */
+		/** @deprecated Since CakePHP 3.4.0-RC4 in core */
 		if ($this->_priority) {
 			$this->_headers['X-Priority'] = $this->_priority;
 		}

+ 1 - 1
src/Model/Behavior/PasswordableBehavior.php

@@ -313,7 +313,7 @@ class PasswordableBehavior extends Behavior {
 		if ($entity->get($formField) !== null) {
 			$cost = !empty($this->_config['hashCost']) ? $this->_config['hashCost'] : 10;
 			$options = ['cost' => $cost];
-			/* @var \Cake\Auth\AbstractPasswordHasher $PasswordHasher */
+			/** @var \Cake\Auth\AbstractPasswordHasher $PasswordHasher */
 			$PasswordHasher = $this->_getPasswordHasher($this->_config['passwordHasher'], $options);
 			$entity->set($field, $PasswordHasher->hash($entity->get($formField)));
 

+ 4 - 0
src/Model/Behavior/SluggedBehavior.php

@@ -90,6 +90,10 @@ class SluggedBehavior extends Behavior {
 	 */
 	protected $_table;
 
+	/**
+	 * @param \Cake\ORM\Table $table
+	 * @param array $config
+	 */
 	public function __construct(Table $table, array $config = []) {
 		$this->_defaultConfig['notices'] = Configure::read('debug');
 		$this->_defaultConfig['label'] = $table->displayField();

+ 2 - 2
src/Model/Table/Table.php

@@ -385,7 +385,7 @@ class Table extends ShimTable {
 			$days = !empty($options['min']) ? $options['min'] : 0;
 			if (!empty($options['after']) && isset($context['data'][$options['after']])) {
 				$compare = $value->subDays($days);
-				/* @var \Cake\I18n\Time $after */
+				/** @var \Cake\I18n\Time $after */
 				$after = $context['data'][$options['after']];
 				if ($after->gt($compare)) {
 					return false;
@@ -393,7 +393,7 @@ class Table extends ShimTable {
 			}
 			if (!empty($options['before']) && isset($context['data'][$options['before']])) {
 				$compare = $value->addDays($days);
-				/* @var \Cake\I18n\Time $before */
+				/** @var \Cake\I18n\Time $before */
 				$before = $context['data'][$options['before']];
 				if ($before->lt($compare)) {
 					return false;

+ 4 - 5
src/Utility/Random.php

@@ -53,10 +53,6 @@ class Random {
 		return $values[static::int(0, $max)];
 	}
 
-	public static function arrayValues($array, $minAmount = null, $maxAmount = null) {
-		//NOT IMPORTANT
-	}
-
 	/**
 	 * 1950-01-01 - 2050-12-31
 	 *
@@ -87,10 +83,11 @@ class Random {
 		return date($formatReturnAs);
 	}
 
-	//TODO
 	/**
 	 * 00:00:00 - 23:59:59
 	 *
+	 * TODO
+	 *
 	 * @param int|null $min
 	 * @param int|null $max
 	 * @param bool|null $formatReturn
@@ -104,6 +101,8 @@ class Random {
 				return $res;
 			}
 		}
+
+		return $res;
 	}
 
 	/**

+ 5 - 0
src/Utility/Text.php

@@ -174,6 +174,11 @@ class Text extends CakeText {
 		return implode($separator, $res);
 	}
 
+	/**
+	 * @param string $str
+	 * @param int $maxCols
+	 * @return string
+	 */
 	public static function convertToOrdTable($str, $maxCols = 20) {
 		$res = '<table>';
 		$r = ['chr' => [], 'ord' => []];

+ 3 - 0
src/View/Helper/QrCodeHelper.php

@@ -299,6 +299,9 @@ class QrCodeHelper extends Helper {
 		return false;
 	}
 
+	/**
+	 * @return void
+	 */
 	public function setEncoding() {
 		//TODO
 	}

+ 29 - 0
tests/TestApp/Model/Table/ResetCommentsTable.php

@@ -7,34 +7,63 @@ use Tools\Model\Table\Table;
 
 class ResetCommentsTable extends Table {
 
+	/**
+	 * @param array $config
+	 * @return void
+	 */
 	public function initialize(array $config) {
 		$this->displayField('comment');
 		parent::initialize($config);
 	}
 
+	/**
+	 * @param \Cake\ORM\Entity $record
+	 * @param array $updateFields
+	 * @return \Cake\ORM\Entity
+	 */
 	public function customCallback(Entity $record, &$updateFields) {
 		$record->comment .= ' xyz';
 		$fields[] = 'some_other_field';
 		return $record;
 	}
 
+	/**
+	 * @param \Cake\ORM\Entity $record
+	 * @param array $updateFields
+	 * @return \Cake\ORM\Entity
+	 */
 	public function customObjectCallback(Entity $record, &$updateFields) {
 		$record['comment'] .= ' xxx';
 		$updateFields[] = 'some_other_field';
 		return $record;
 	}
 
+	/**
+	 * @param \Cake\ORM\Entity $record
+	 * @param array $updateFields
+	 * @return \Cake\ORM\Entity
+	 */
 	public static function customStaticCallback(Entity $record, &$updateFields) {
 		$record['comment'] .= ' yyy';
 		$updateFields[] = 'some_other_field';
 		return $record;
 	}
 
+	/**
+	 * @param \Cake\ORM\Entity $record
+	 * @param array $updateFields
+	 * @return \Cake\ORM\Entity
+	 */
 	public static function fieldsCallback(Entity $record, &$updateFields) {
 		$record['comment'] = 'foo';
 		return $record;
 	}
 
+	/**
+	 * @param \Cake\ORM\Entity $record
+	 * @param array $updateFields
+	 * @return \Cake\ORM\Entity
+	 */
 	public static function fieldsCallbackAuto(Entity $record, &$updateFields) {
 		$record['comment'] = 'bar';
 		$updateFields[] = 'comment';

+ 9 - 0
tests/TestCase/BootstrapTest.php

@@ -135,14 +135,23 @@ class BootstrapTest extends TestCase {
 		$this->assertEquals(false, $is);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testEnt() {
 		//$this->assertEquals($expected, $is);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testEntDec() {
 		//$this->assertEquals($expected, $is);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testReturns() {
 		//$this->assertEquals($expected, $is);
 	}

+ 36 - 0
tests/TestCase/Controller/Component/MobileComponentTest.php

@@ -64,6 +64,9 @@ class MobileComponentTest extends TestCase {
 		unset($this->Controller);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testDetect() {
 		$is = $this->Controller->Mobile->detect();
 		$this->assertFalse($is);
@@ -73,12 +76,18 @@ class MobileComponentTest extends TestCase {
 		$this->assertTrue($is);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileNotMobile() {
 		$this->Controller->Mobile->config('on', 'initialize');
 		$this->Controller->Mobile->initialize([]);
 		$this->assertFalse($this->Controller->Mobile->isMobile);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileForceActivated() {
 		$this->Controller->request->query['mobile'] = 1;
 
@@ -94,6 +103,9 @@ class MobileComponentTest extends TestCase {
 		$this->assertEquals(['desktopUrl' => '/?mobile=0'], $this->Controller->viewVars);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileForceDeactivated() {
 		$this->Controller->request->query['mobile'] = 0;
 
@@ -107,6 +119,9 @@ class MobileComponentTest extends TestCase {
 		$this->assertEquals(['mobileUrl' => '/?mobile=1'], $this->Controller->viewVars);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileFakeMobile() {
 		$_SERVER['HTTP_USER_AGENT'] = 'Some Android device';
 
@@ -118,6 +133,9 @@ class MobileComponentTest extends TestCase {
 		$this->assertSame(['isMobile' => 1, 'setMobile' => 1], $configure);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileFakeMobileForceDeactivated() {
 		$this->Controller->request->query['mobile'] = 0;
 		$_SERVER['HTTP_USER_AGENT'] = 'Some Android device';
@@ -135,6 +153,9 @@ class MobileComponentTest extends TestCase {
 		$this->assertSame(['isMobile' => 1, 'setMobile' => 0], $configure);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileFakeMobileAuto() {
 		$this->Controller->Mobile->config('auto', true);
 		$_SERVER['HTTP_USER_AGENT'] = 'Some Android device';
@@ -147,6 +168,9 @@ class MobileComponentTest extends TestCase {
 		$this->assertTrue($this->Controller->Mobile->setMobile);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileVendorEngineCake() {
 		$this->Controller->Mobile->config('engine', '');
 		$_SERVER['HTTP_USER_AGENT'] = 'Some Android device';
@@ -156,6 +180,9 @@ class MobileComponentTest extends TestCase {
 		$this->assertTrue($this->Controller->Mobile->isMobile);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileCustomMobileInvalid() {
 		$_SERVER['HTTP_USER_AGENT'] = 'Some Foo device';
 
@@ -163,6 +190,9 @@ class MobileComponentTest extends TestCase {
 		$this->assertFalse($this->Controller->Mobile->isMobile);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileCustomMobile() {
 		$_SERVER['HTTP_USER_AGENT'] = 'Some Android device';
 
@@ -170,6 +200,9 @@ class MobileComponentTest extends TestCase {
 		$this->assertTrue($this->Controller->Mobile->isMobile);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileCustomMobileTablet() {
 		$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25';
 
@@ -177,6 +210,9 @@ class MobileComponentTest extends TestCase {
 		$this->assertTrue($this->Controller->Mobile->isMobile);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMobileEngineClosure() {
 		$closure = function() {
 			return $_SERVER['HTTP_USER_AGENT'] === 'Foo';

+ 3 - 0
tests/TestCase/HtmlDom/HtmlDomTest.php

@@ -12,6 +12,9 @@ class HtmlDomTest extends TestCase {
 	 */
 	public $HtmlDom;
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 

+ 3 - 0
tests/TestCase/Mailer/EmailTest.php

@@ -376,6 +376,9 @@ html-part
 		$this->assertTrue((bool)$res);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function _testComplexeHtmlWithEmbeddedImages() {
 		$file = Plugin::path('Tools') . 'tests' . DS . 'test_files' . DS . 'img' . DS . 'hotel.png';
 		$this->assertTrue(file_exists($file));

+ 3 - 0
tests/TestCase/Model/Behavior/JsonableBehaviorTest.php

@@ -21,6 +21,9 @@ class JsonableBehaviorTest extends TestCase {
 	 */
 	public $Comments;
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 

+ 3 - 0
tests/TestCase/Model/Behavior/PasswordableBehaviorTest.php

@@ -43,6 +43,9 @@ class PasswordableBehaviorTest extends TestCase {
 		Router::setRequestInfo(new Request());
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		TableRegistry::clear();
 

+ 6 - 0
tests/TestCase/Model/Behavior/ResetBehaviorTest.php

@@ -24,6 +24,9 @@ class ResetBehaviorTest extends TestCase {
 	 */
 	public $fixtures = ['plugin.tools.reset_comments'];
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 
@@ -33,6 +36,9 @@ class ResetBehaviorTest extends TestCase {
 		$this->Table->addBehavior('Tools.Reset');
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		TableRegistry::clear();
 

+ 3 - 0
tests/TestCase/Model/Behavior/StringBehaviorTest.php

@@ -19,6 +19,9 @@ class StringBehaviorTest extends TestCase {
 	 */
 	public $Comments;
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 

+ 3 - 0
tests/TestCase/Model/Table/TableTest.php

@@ -39,6 +39,9 @@ class TableTest extends TestCase {
 		$this->Posts->belongsTo('Authors');
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		TableRegistry::clear();
 

+ 15 - 0
tests/TestCase/Model/Table/TokensTableTest.php

@@ -17,22 +17,34 @@ class TokensTableTest extends TestCase {
 	 */
 	public $fixtures = ['plugin.Tools.Tokens'];
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 
 		$this->Tokens = TableRegistry::get('Tools.Tokens');
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testTokenInstance() {
 		$this->assertInstanceOf('Tools\Model\Table\TokensTable', $this->Tokens);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testGenerateKey() {
 		$key = $this->Tokens->generateKey(4);
 		//pr($key);
 		$this->assertTrue(!empty($key) && strlen($key) === 4);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testNewKeySpendKey() {
 		$key = $this->Tokens->newKey('test', null, null, 'xyz');
 		$this->assertTrue(!empty($key));
@@ -52,6 +64,9 @@ class TokensTableTest extends TestCase {
 		$this->assertFalse($res);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testGarbageCollector() {
 		$data = [
 			'created' => date(FORMAT_DB_DATETIME, time() - 3 * MONTH),

+ 6 - 0
tests/TestCase/TestSuite/IntegrationTestCaseTest.php

@@ -6,10 +6,16 @@ use Tools\TestSuite\IntegrationTestCase;
 
 class IntegrationTestCaseTest extends IntegrationTestCase {
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		parent::tearDown();
 	}

+ 6 - 0
tests/TestCase/TestSuite/TestCaseTest.php

@@ -6,10 +6,16 @@ use Tools\TestSuite\TestCase;
 
 class TestCaseTest extends TestCase {
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		parent::tearDown();
 	}

+ 6 - 0
tests/TestCase/TestSuite/ToolsTestTraitTest.php

@@ -6,6 +6,9 @@ use Tools\TestSuite\TestCase;
 
 class ToolsTestTraitTest extends TestCase {
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 
@@ -13,6 +16,9 @@ class ToolsTestTraitTest extends TestCase {
 		$_SERVER['argv'] = [];
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		parent::tearDown();
 

+ 3 - 0
tests/TestCase/Utility/LanguageTest.php

@@ -7,6 +7,9 @@ use Tools\Utility\Language;
 
 class LanguageTest extends TestCase {
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 

+ 28 - 11
tests/TestCase/Utility/MimeTest.php

@@ -14,22 +14,34 @@ class MimeTest extends TestCase {
 	 */
 	public $Mime;
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 
 		$this->Mime = new Mime();
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testObject() {
 		$this->assertTrue(is_object($this->Mime));
 		$this->assertInstanceOf('Tools\Utility\Mime', $this->Mime);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testAll() {
 		$res = $this->Mime->mimeTypes();
 		$this->assertTrue(is_array($res) && count($res) > 100);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testSingle() {
 		$res = $this->Mime->getMimeTypeByAlias('odxs');
 		$this->assertFalse($res);
@@ -38,11 +50,17 @@ class MimeTest extends TestCase {
 		$this->assertEquals('application/vnd.oasis.opendocument.spreadsheet', $res);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testOverwrite() {
 		$res = $this->Mime->getMimeTypeByAlias('ics');
 		$this->assertEquals('application/ics', $res);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testReverseToSingle() {
 		$res = $this->Mime->getMimeTypeByAlias('html');
 		$this->assertEquals('text/html', $res);
@@ -51,6 +69,9 @@ class MimeTest extends TestCase {
 		$this->assertEquals('text/csv', $res);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testReverseToMultiple() {
 		$res = $this->Mime->getMimeTypeByAlias('html', false);
 		$this->assertTrue(is_array($res));
@@ -62,8 +83,6 @@ class MimeTest extends TestCase {
 	}
 
 	/**
-	 * Test fake files
-	 *
 	 * @return void
 	 */
 	public function testCorrectFileExtension() {
@@ -74,8 +93,6 @@ class MimeTest extends TestCase {
 	}
 
 	/**
-	 * Test fake files
-	 *
 	 * @return void
 	 */
 	public function testWrongFileExtension() {
@@ -87,8 +104,6 @@ class MimeTest extends TestCase {
 	}
 
 	/**
-	 * testgetMimeTypeByAlias()
-	 *
 	 * @return void
 	 */
 	public function testgetMimeTypeByAlias() {
@@ -103,8 +118,6 @@ class MimeTest extends TestCase {
 	}
 
 	/**
-	 * Test fake files
-	 *
 	 * @return void
 	 */
 	public function testEncoding() {
@@ -126,8 +139,6 @@ class MimeTest extends TestCase {
 	}
 
 	/**
-	 * MimeLibTest::testDifferenceBetweenPluginAndCore()
-	 *
 	 * @return void
 	 */
 	public function testDifferenceBetweenPluginAndCore() {
@@ -153,13 +164,15 @@ class MimeTest extends TestCase {
 		foreach ($plugin as $key => $value) {
 			$diff['pluginonly'][$key] = $value;
 		}
-		//$this->debug($diff);
 	}
 
 }
 
 class TestCakeResponse extends Response {
 
+	/**
+	 * @return array
+	 */
 	public function getMimeTypes() {
 		return $this->_mimeTypes;
 	}
@@ -168,6 +181,10 @@ class TestCakeResponse extends Response {
 
 class TestMime extends Mime {
 
+	/**
+	 * @param bool $coreHasPrecedence
+	 * @return array
+	 */
 	public function getMimeTypes($coreHasPrecedence = false) {
 		return $this->_mimeTypesExt;
 	}

+ 3 - 0
tests/TestCase/Utility/NumberTest.php

@@ -12,6 +12,9 @@ class NumberTest extends TestCase {
 	 */
 	public $Number;
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 

+ 12 - 0
tests/TestCase/Utility/RandomTest.php

@@ -7,12 +7,18 @@ use Tools\Utility\Random;
 
 class RandomTest extends TestCase {
 
+	/**
+	 * @return void
+	 */
 	public function testInt() {
 		$is = Random::int(2, 200);
 		//pr($is);
 		$this->assertTrue($is >= 2 && $is <= 200);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testArrayValue() {
 		$array = [
 			'x',
@@ -32,11 +38,17 @@ class RandomTest extends TestCase {
 		$this->assertTrue(in_array($is, $array));
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testPwd() {
 		$result = Random::pwd(10);
 		$this->assertTrue(mb_strlen($result) === 10);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testPronounceablePwd() {
 		$is = Random::pronounceablePwd(6);
 		//pr($is);

+ 18 - 0
tests/TestCase/Utility/TextTest.php

@@ -14,12 +14,18 @@ class TextTest extends TestCase {
 	 */
 	public $Text;
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 
 		$this->Text = new Text();
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testReadTab() {
 		$data = <<<TXT
 some	tabbed	data
@@ -46,6 +52,9 @@ TXT;
 		$this->assertSame(['and', 'a', 'third'], $result[2]);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testConvertToOrd() {
 		$is = $this->Text->convertToOrd('h H');
 		//pr($is);
@@ -55,17 +64,26 @@ TXT;
 		//pr($is);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testConvertToOrdTable() {
 		$is = $this->Text->convertToOrdTable('x' . PHP_EOL . 'x' . PHP_EOL . 'x' . PHP_EOL . 'x' . PHP_EOL . 'x' . "\t" . 'x');
 		//pr($is);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testMaxWords() {
 		$this->assertEquals('Taylor...', Text::maxWords('Taylor Otwell', 1));
 		$this->assertEquals('Taylor___', Text::maxWords('Taylor Otwell', 1, ['ellipsis' => '___']));
 		$this->assertEquals('Taylor Otwell', Text::maxWords('Taylor Otwell', 3));
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testWords() {
 		$is = $this->Text->words('Hochhaus, Unter dem Bau von ae Äußeren Einflüssen - und von Autos.', ['min_char' => 3]);
 		$this->assertTrue(!empty($is) && is_array($is) && count($is) === 9);

+ 12 - 0
tests/TestCase/Utility/TimeTest.php

@@ -15,6 +15,9 @@ class TimeTest extends TestCase {
 	 */
 	public $Time;
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		$this->Time = new Time();
 
@@ -734,6 +737,9 @@ class TimeTest extends TestCase {
 		$this->assertEquals('Europe/Vaduz', $result);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testCweeks() {
 		//$this->out($this->_header(__FUNCTION__), true);
 		$ret = $this->Time->cweeks('2004');
@@ -754,6 +760,9 @@ class TimeTest extends TestCase {
 		*/
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testCweekBeginning() {
 		//$this->out($this->_header(__FUNCTION__), true);
 		$values = [
@@ -787,6 +796,9 @@ class TimeTest extends TestCase {
 		}
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testCweekEnding() {
 		//$this->out($this->_header(__FUNCTION__), true);
 

+ 3 - 0
tests/TestCase/View/Helper/FormatHelperTest.php

@@ -369,6 +369,9 @@ TEXT;
 		$this->assertTextNotContains('<th>', $is);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		parent::tearDown();
 

+ 3 - 0
tests/TestCase/View/Helper/HtmlHelperTest.php

@@ -19,6 +19,9 @@ class HtmlHelperTest extends TestCase {
 	 */
 	protected $Html;
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 

+ 6 - 0
tests/TestCase/View/Helper/NumberHelperTest.php

@@ -13,6 +13,9 @@ use Tools\View\Helper\NumberHelper;
  */
 class NumberHelperTest extends TestCase {
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 
@@ -114,6 +117,9 @@ class NumberHelperTest extends TestCase {
 		$this->assertEquals('2,5 TB', $is);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		parent::tearDown();
 

+ 3 - 0
tests/TestCase/View/Helper/TextHelperTest.php

@@ -14,6 +14,9 @@ class TextHelperTest extends TestCase {
 	 */
 	public $Text;
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 

+ 3 - 0
tests/TestCase/View/Helper/TimeHelperTest.php

@@ -12,6 +12,9 @@ use Tools\View\Helper\TimeHelper;
  */
 class TimeHelperTest extends TestCase {
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 		parent::setUp();
 

+ 3 - 0
tests/TestCase/View/Helper/TimelineHelperTest.php

@@ -75,6 +75,9 @@ class TimelineHelperTest extends TestCase {
 		$this->assertContains('\'start\': new Date(', $result);
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		parent::tearDown();
 

+ 16 - 4
tests/TestCase/View/Helper/TreeHelperTest.php

@@ -74,6 +74,9 @@ class TreeHelperTest extends TestCase {
 		}
 	}
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 		unset($this->Table);
 
@@ -81,6 +84,9 @@ class TreeHelperTest extends TestCase {
 		parent::tearDown();
 	}
 
+	/**
+	 * @return void
+	 */
 	public function testObject() {
 		$this->assertInstanceOf('Tools\View\Helper\TreeHelper', $this->Tree);
 	}
@@ -494,21 +500,27 @@ TEXT;
 TEXT;
 		$output = str_replace(["\t", "\r", "\n"], '', $output);
 		$expected = str_replace(["\t", "\r", "\n"], '', $expected);
-		//debug($output);
-		//debug($expected);
 		$this->assertTextEquals($expected, $output);
 	}
 
+	/**
+	 * @param array $data
+	 * @return string|null
+	 */
 	public function _myCallback($data) {
 		if (!empty($data['data']['hide'])) {
-			return;
+			return null;
 		}
 		return $data['data']['name'] . ($data['activePathElement'] ? ' (active)' : '');
 	}
 
+	/**
+	 * @param array $data
+	 * @return string|null
+	 */
 	public function _myCallbackSiblings($data) {
 		if (!empty($data['data']['hide'])) {
-			return;
+			return null;
 		}
 		if ($data['depth'] == 0 && $data['isSibling']) {
 			return $data['data']['name'] . ' (sibling)';