Mark Scherer 9 年之前
父节点
当前提交
ed475a6fa0
共有 31 个文件被更改,包括 158 次插入16 次删除
  1. 6 0
      tests/Fixture/JsonableCommentsFixture.php
  2. 6 0
      tests/Fixture/StringCommentsFixture.php
  3. 14 2
      tests/TestApp/Controller/Component/TestComponent.php
  4. 4 0
      tests/TestApp/Model/Entity/BitmaskedComment.php
  5. 3 0
      tests/TestApp/Model/Table/BitmaskedCommentsTable.php
  6. 3 0
      tests/TestApp/Model/Table/JsonableCommentsTable.php
  7. 3 0
      tests/TestCase/Controller/Component/CommonComponentTest.php
  8. 9 0
      tests/TestCase/Controller/Component/FlashComponentTest.php
  9. 3 0
      tests/TestCase/Controller/Component/MobileComponentTest.php
  10. 12 0
      tests/TestCase/Controller/ControllerTest.php
  11. 6 0
      tests/TestCase/Form/ContactFormTest.php
  12. 6 3
      tests/TestCase/HtmlDom/HtmlDomTest.php
  13. 6 0
      tests/TestCase/Model/Behavior/BitmaskedBehaviorTest.php
  14. 9 0
      tests/TestCase/Model/Behavior/ConfirmableBehaviorTest.php
  15. 6 0
      tests/TestCase/Model/Behavior/JsonableBehaviorTest.php
  16. 6 0
      tests/TestCase/Model/Behavior/NeighborBehaviorTest.php
  17. 3 0
      tests/TestCase/Model/Behavior/PasswordableBehaviorTest.php
  18. 9 0
      tests/TestCase/Model/Behavior/ResetBehaviorTest.php
  19. 6 0
      tests/TestCase/Model/Behavior/StringBehaviorTest.php
  20. 6 0
      tests/TestCase/Model/Entity/EntityTest.php
  21. 6 0
      tests/TestCase/Model/Table/TableTest.php
  22. 8 2
      tests/TestCase/Model/Table/TokensTableTest.php
  23. 0 2
      tests/TestCase/TestSuite/IntegrationTestCaseTest.php
  24. 0 2
      tests/TestCase/TestSuite/TestCaseTest.php
  25. 0 2
      tests/TestCase/TestSuite/ToolsTestTraitTest.php
  26. 3 0
      tests/TestCase/Utility/MimeTest.php
  27. 4 1
      tests/TestCase/Utility/NumberTest.php
  28. 4 1
      tests/TestCase/Utility/TimeTest.php
  29. 3 0
      tests/TestCase/View/Helper/FlashHelperTest.php
  30. 1 1
      tests/TestCase/View/Helper/FormHelperTest.php
  31. 3 0
      tests/TestCase/View/Helper/FormatHelperTest.php

+ 6 - 0
tests/Fixture/JsonableCommentsFixture.php

@@ -6,6 +6,9 @@ use Cake\TestSuite\Fixture\TestFixture;
 
 
 class JsonableCommentsFixture extends TestFixture {
 class JsonableCommentsFixture extends TestFixture {
 
 
+	/**
+	 * @var array
+	 */
 	public $fields = [
 	public $fields = [
 		'id' => ['type' => 'integer'],
 		'id' => ['type' => 'integer'],
 		'comment' => ['type' => 'string', 'length' => 255, 'null' => false],
 		'comment' => ['type' => 'string', 'length' => 255, 'null' => false],
@@ -15,6 +18,9 @@ class JsonableCommentsFixture extends TestFixture {
 		'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
 		'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
 	];
 	];
 
 
+	/**
+	 * @var array
+	 */
 	public $records = [
 	public $records = [
 	];
 	];
 
 

+ 6 - 0
tests/Fixture/StringCommentsFixture.php

@@ -6,6 +6,9 @@ use Cake\TestSuite\Fixture\TestFixture;
 
 
 class StringCommentsFixture extends TestFixture {
 class StringCommentsFixture extends TestFixture {
 
 
+	/**
+	 * @var array
+	 */
 	public $fields = [
 	public $fields = [
 		'id' => ['type' => 'integer'],
 		'id' => ['type' => 'integer'],
 		'comment' => ['type' => 'string', 'length' => 255, 'null' => false],
 		'comment' => ['type' => 'string', 'length' => 255, 'null' => false],
@@ -14,6 +17,9 @@ class StringCommentsFixture extends TestFixture {
 		'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
 		'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
 	];
 	];
 
 
+	/**
+	 * @var array
+	 */
 	public $records = [
 	public $records = [
 	];
 	];
 
 

+ 14 - 2
tests/TestApp/Controller/Component/TestComponent.php

@@ -7,16 +7,28 @@ use Shim\Controller\Component\Component;
 
 
 class TestComponent extends Component {
 class TestComponent extends Component {
 
 
-	public $Controller;
-
+	/**
+	 * @var bool
+	 */
 	public $isInit = false;
 	public $isInit = false;
 
 
+	/**
+	 * @var bool
+	 */
 	public $isStartup = false;
 	public $isStartup = false;
 
 
+	/**
+	 * @param \Cake\Event\Event $event
+	 * @return void
+	 */
 	public function beforeFilter(Event $event) {
 	public function beforeFilter(Event $event) {
 		$this->isInit = true;
 		$this->isInit = true;
 	}
 	}
 
 
+	/**
+	 * @param \Cake\Event\Event $event
+	 * @return void
+	 */
 	public function startup(Event $event) {
 	public function startup(Event $event) {
 		$this->isStartup = true;
 		$this->isStartup = true;
 	}
 	}

+ 4 - 0
tests/TestApp/Model/Entity/BitmaskedComment.php

@@ -6,6 +6,10 @@ use Tools\Model\Entity\Entity;
 
 
 class BitmaskedComment extends Entity {
 class BitmaskedComment extends Entity {
 
 
+	/**
+	 * @param mixed|null $value
+	 * @return mixed
+	 */
 	public static function statuses($value = null) {
 	public static function statuses($value = null) {
 		$options = [
 		$options = [
 			static::STATUS_ACTIVE => __d('tools', 'Active'),
 			static::STATUS_ACTIVE => __d('tools', 'Active'),

+ 3 - 0
tests/TestApp/Model/Table/BitmaskedCommentsTable.php

@@ -6,6 +6,9 @@ use Tools\Model\Table\Table;
 
 
 class BitmaskedCommentsTable extends Table {
 class BitmaskedCommentsTable extends Table {
 
 
+	/**
+	 * @var array
+	 */
 	public $validate = [
 	public $validate = [
 		'status' => [
 		'status' => [
 			'notBlank' => [
 			'notBlank' => [

+ 3 - 0
tests/TestApp/Model/Table/JsonableCommentsTable.php

@@ -6,6 +6,9 @@ use Tools\Model\Table\Table;
 
 
 class JsonableCommentsTable extends Table {
 class JsonableCommentsTable extends Table {
 
 
+	/**
+	 * @var array
+	 */
 	public $validate = [
 	public $validate = [
 	];
 	];
 
 

+ 3 - 0
tests/TestCase/Controller/Component/CommonComponentTest.php

@@ -171,6 +171,9 @@ class CommonComponentTest extends TestCase {
  */
  */
 class CommonComponentTestController extends Controller {
 class CommonComponentTestController extends Controller {
 
 
+	/**
+	 * @var array
+	 */
 	public $components = ['Tools.Common'];
 	public $components = ['Tools.Common'];
 
 
 }
 }

+ 9 - 0
tests/TestCase/Controller/Component/FlashComponentTest.php

@@ -121,10 +121,19 @@ class FlashComponentTest extends TestCase {
  */
  */
 class FlashComponentTestController extends Controller {
 class FlashComponentTestController extends Controller {
 
 
+	/**
+	 * @var array
+	 */
 	public $components = ['Tools.Flash'];
 	public $components = ['Tools.Flash'];
 
 
+	/**
+	 * @var bool
+	 */
 	public $failed = false;
 	public $failed = false;
 
 
+	/**
+	 * @var array
+	 */
 	public $testHeaders = [];
 	public $testHeaders = [];
 
 
 	public function fail() {
 	public function fail() {

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

@@ -17,6 +17,9 @@ use Tools\TestSuite\TestCase;
  */
  */
 class MobileComponentTest extends TestCase {
 class MobileComponentTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = ['core.sessions'];
 	public $fixtures = ['core.sessions'];
 
 
 	/**
 	/**

+ 12 - 0
tests/TestCase/Controller/ControllerTest.php

@@ -16,10 +16,19 @@ use Tools\TestSuite\TestCase;
  */
  */
 class ControllerTest extends TestCase {
 class ControllerTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = ['plugin.Tools.ToolsUsers'];
 	public $fixtures = ['plugin.Tools.ToolsUsers'];
 
 
+	/**
+	 * @var Cake\Controller\Controller
+	 */
 	public $Controller;
 	public $Controller;
 
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 	public function setUp() {
 		parent::setUp();
 		parent::setUp();
 
 
@@ -29,6 +38,9 @@ class ControllerTest extends TestCase {
 		$this->Controller->startupProcess();
 		$this->Controller->startupProcess();
 	}
 	}
 
 
+	/**
+	 * @return void
+	 */
 	public function tearDown() {
 	public function tearDown() {
 		parent::tearDown();
 		parent::tearDown();
 
 

+ 6 - 0
tests/TestCase/Form/ContactFormTest.php

@@ -19,11 +19,17 @@ use Tools\TestSuite\TestCase;
 
 
 class ContactFormTest extends TestCase {
 class ContactFormTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = [
 	public $fixtures = [
 		'core.posts', 'core.authors',
 		'core.posts', 'core.authors',
 		'plugin.tools.tools_users', 'plugin.tools.roles',
 		'plugin.tools.tools_users', 'plugin.tools.roles',
 	];
 	];
 
 
+	/**
+	 * @var \Tools\Form\ContactForm
+	 */
 	public $Form;
 	public $Form;
 
 
 	/**
 	/**

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

@@ -8,7 +8,10 @@ use Tools\TestSuite\TestCase;
 
 
 class HtmlDomTest extends TestCase {
 class HtmlDomTest extends TestCase {
 
 
-	public $HtmlDom = null;
+	/**
+	 * @var \Tools\HtmlDom\HtmlDom
+	 */
+	public $HtmlDom;
 
 
 	public function setUp() {
 	public function setUp() {
 		parent::setUp();
 		parent::setUp();
@@ -22,8 +25,8 @@ class HtmlDomTest extends TestCase {
 	 * @return void
 	 * @return void
 	 */
 	 */
 	public function testBasics() {
 	public function testBasics() {
-		$html = new HtmlDom('<div id="hello">Hello</div><div id="world">World</div>');
-		$result = $html->find('div', 1)->innertext;
+		$this->HtmlDom = new HtmlDom('<div id="hello">Hello</div><div id="world">World</div>');
+		$result = $this->HtmlDom->find('div', 1)->innertext;
 		$this->assertSame('World', $result);
 		$this->assertSame('World', $result);
 	}
 	}
 
 

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

@@ -12,10 +12,16 @@ use Tools\TestSuite\TestCase;
 
 
 class BitmaskedBehaviorTest extends TestCase {
 class BitmaskedBehaviorTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = [
 	public $fixtures = [
 		'plugin.tools.bitmasked_comments'
 		'plugin.tools.bitmasked_comments'
 	];
 	];
 
 
+	/**
+	 * @var \Tools\Model\Table\Table
+	 */
 	public $Comments;
 	public $Comments;
 
 
 	public function setUp() {
 	public function setUp() {

+ 9 - 0
tests/TestCase/Model/Behavior/ConfirmableBehaviorTest.php

@@ -8,10 +8,19 @@ use Tools\TestSuite\TestCase;
 
 
 class ConfirmableBehaviorTest extends TestCase {
 class ConfirmableBehaviorTest extends TestCase {
 
 
+	/**
+	 * @var \Tools\Model\Behavior\ConfirmableBehavior
+	 */
 	public $ConfirmableBehavior;
 	public $ConfirmableBehavior;
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = ['plugin.Tools.SluggedArticles'];
 	public $fixtures = ['plugin.Tools.SluggedArticles'];
 
 
+	/**
+	 * @return void
+	 */
 	public function setUp() {
 	public function setUp() {
 		parent::setUp();
 		parent::setUp();
 	}
 	}

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

@@ -9,10 +9,16 @@ use Tools\TestSuite\TestCase;
 
 
 class JsonableBehaviorTest extends TestCase {
 class JsonableBehaviorTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = [
 	public $fixtures = [
 		'plugin.tools.jsonable_comments'
 		'plugin.tools.jsonable_comments'
 	];
 	];
 
 
+	/**
+	 * @var \Tools\Model\Table\Table
+	 */
 	public $Comments;
 	public $Comments;
 
 
 	public function setUp() {
 	public function setUp() {

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

@@ -10,8 +10,14 @@ use Tools\TestSuite\TestCase;
 
 
 class NeighborBehaviorTest extends TestCase {
 class NeighborBehaviorTest extends TestCase {
 
 
+	/**
+	 * @var \Tools\Model\Table\Table
+	 */
 	public $Table;
 	public $Table;
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = ['plugin.tools.stories'];
 	public $fixtures = ['plugin.tools.stories'];
 
 
 	public function setUp() {
 	public function setUp() {

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

@@ -17,6 +17,9 @@ use Tools\TestSuite\TestCase;
 
 
 class PasswordableBehaviorTest extends TestCase {
 class PasswordableBehaviorTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = [
 	public $fixtures = [
 		'plugin.tools.tools_users', 'plugin.tools.roles',
 		'plugin.tools.tools_users', 'plugin.tools.roles',
 	];
 	];

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

@@ -10,10 +10,19 @@ use Tools\TestSuite\TestCase;
 
 
 class ResetBehaviorTest extends TestCase {
 class ResetBehaviorTest extends TestCase {
 
 
+	/**
+	 * @var \Tools\Model\Behavior\ResetBehavior
+	 */
 	public $ResetBehavior;
 	public $ResetBehavior;
 
 
+	/**
+	 * @var \Tools\Model\Table\Table
+	 */
 	public $Table;
 	public $Table;
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = ['plugin.tools.reset_comments'];
 	public $fixtures = ['plugin.tools.reset_comments'];
 
 
 	public function setUp() {
 	public function setUp() {

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

@@ -9,10 +9,16 @@ use Tools\TestSuite\TestCase;
 
 
 class StringBehaviorTest extends TestCase {
 class StringBehaviorTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = [
 	public $fixtures = [
 		'plugin.tools.string_comments'
 		'plugin.tools.string_comments'
 	];
 	];
 
 
+	/**
+	 * @var \Tools\Model\Table\Table
+	 */
 	public $Comments;
 	public $Comments;
 
 
 	public function setUp() {
 	public function setUp() {

+ 6 - 0
tests/TestCase/Model/Entity/EntityTest.php

@@ -11,10 +11,16 @@ use Tools\TestSuite\TestCase;
 
 
 class PasswordableBehaviorTest extends TestCase {
 class PasswordableBehaviorTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = [
 	public $fixtures = [
 		'plugin.tools.tools_users', 'plugin.tools.roles',
 		'plugin.tools.tools_users', 'plugin.tools.roles',
 	];
 	];
 
 
+	/**
+	 * @var \Tools\Model\Table\Table;
+	 */
 	public $Users;
 	public $Users;
 
 
 	/**
 	/**

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

@@ -19,11 +19,17 @@ use Tools\TestSuite\TestCase;
 
 
 class TableTest extends TestCase {
 class TableTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = [
 	public $fixtures = [
 		'core.posts', 'core.authors',
 		'core.posts', 'core.authors',
 		'plugin.tools.tools_users', 'plugin.tools.roles',
 		'plugin.tools.tools_users', 'plugin.tools.roles',
 	];
 	];
 
 
+	/**
+	 * @var \Tools\Model\Table\Table;
+	 */
 	public $Users;
 	public $Users;
 
 
 	/**
 	/**

+ 8 - 2
tests/TestCase/Model/Table/TokensTableTest.php

@@ -8,8 +8,14 @@ use Tools\TestSuite\TestCase;
 
 
 class TokensTableTest extends TestCase {
 class TokensTableTest extends TestCase {
 
 
-	public $Tokens = null;
-
+	/**
+	 * @var \Tools\Model\Table\TokensTable;
+	 */
+	public $Tokens;
+
+	/**
+	 * @var array
+	 */
 	public $fixtures = ['plugin.Tools.Tokens'];
 	public $fixtures = ['plugin.Tools.Tokens'];
 
 
 	public function setUp() {
 	public function setUp() {

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

@@ -6,8 +6,6 @@ use Tools\TestSuite\IntegrationTestCase;
 
 
 class IntegrationTestCaseTest extends IntegrationTestCase {
 class IntegrationTestCaseTest extends IntegrationTestCase {
 
 
-	public $TestCase;
-
 	public function setUp() {
 	public function setUp() {
 		parent::setUp();
 		parent::setUp();
 	}
 	}

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

@@ -6,8 +6,6 @@ use Tools\TestSuite\TestCase;
 
 
 class TestCaseTest extends TestCase {
 class TestCaseTest extends TestCase {
 
 
-	public $TestCase;
-
 	public function setUp() {
 	public function setUp() {
 		parent::setUp();
 		parent::setUp();
 	}
 	}

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

@@ -6,8 +6,6 @@ use Tools\TestSuite\TestCase;
 
 
 class ToolsTestTraitTest extends TestCase {
 class ToolsTestTraitTest extends TestCase {
 
 
-	public $TestCase;
-
 	public function setUp() {
 	public function setUp() {
 		parent::setUp();
 		parent::setUp();
 
 

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

@@ -9,6 +9,9 @@ use Tools\Utility\Mime;
 
 
 class MimeTest extends TestCase {
 class MimeTest extends TestCase {
 
 
+	/**
+	 * @var \Tools\Utility\Mime
+	 */
 	public $Mime;
 	public $Mime;
 
 
 	public function setUp() {
 	public function setUp() {

+ 4 - 1
tests/TestCase/Utility/NumberTest.php

@@ -9,7 +9,10 @@ use Tools\Utility\Number;
 
 
 class NumberTest extends TestCase {
 class NumberTest extends TestCase {
 
 
-	public $Number = null;
+	/**
+	 * @var \Tools\Utility\Number
+	 */
+	public $Number;
 
 
 	public function setUp() {
 	public function setUp() {
 		parent::setUp();
 		parent::setUp();

+ 4 - 1
tests/TestCase/Utility/TimeTest.php

@@ -9,7 +9,10 @@ use Tools\Utility\Time;
 
 
 class TimeTest extends TestCase {
 class TimeTest extends TestCase {
 
 
-	public $Time = null;
+	/**
+	 * @var \Tools\Utility\Time
+	 */
+	public $Time;
 
 
 	public function setUp() {
 	public function setUp() {
 		$this->Time = new Time();
 		$this->Time = new Time();

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

@@ -13,6 +13,9 @@ use Tools\View\Helper\FlashHelper;
  */
  */
 class FlashHelperTest extends TestCase {
 class FlashHelperTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = ['core.sessions'];
 	public $fixtures = ['core.sessions'];
 
 
 	/**
 	/**

+ 1 - 1
tests/TestCase/View/Helper/FormHelperTest.php

@@ -14,7 +14,7 @@ use Tools\View\Helper\FormHelper;
 class FormHelperTest extends TestCase {
 class FormHelperTest extends TestCase {
 
 
 	/**
 	/**
-	 * @var\Tools\View\Helper\FormHelper
+	 * @var \Tools\View\Helper\FormHelper
 	 */
 	 */
 	public $Form;
 	public $Form;
 
 

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

@@ -12,6 +12,9 @@ use Tools\View\Helper\FormatHelper;
  */
  */
 class FormatHelperTest extends TestCase {
 class FormatHelperTest extends TestCase {
 
 
+	/**
+	 * @var array
+	 */
 	public $fixtures = ['core.sessions'];
 	public $fixtures = ['core.sessions'];
 
 
 	/**
 	/**