Browse Source

Use types consistently.

mark_story 12 years ago
parent
commit
bbcddb3f71

+ 2 - 2
src/Console/Command/Task/ModelTask.php

@@ -481,14 +481,14 @@ class ModelTask extends BakeTask {
 			return [];
 		}
 		if (in_array('created', $fields) || in_array('modified', $fields)) {
-			$behaviors['Timestamp'] = '';
+			$behaviors['Timestamp'] = [];
 		}
 
 		if (in_array('lft', $fields) && $schema->columnType('lft') === 'integer' &&
 			in_array('rght', $fields) && $schema->columnType('rght') === 'integer' &&
 			in_array('parent_id', $fields)
 		) {
-			$behaviors['Tree'] = '';
+			$behaviors['Tree'] = [];
 		}
 
 		$counterCache = [];

+ 2 - 2
tests/TestCase/Console/Command/Task/ModelTaskTest.php

@@ -442,11 +442,11 @@ class ModelTaskTest extends TestCase {
 	public function testGetBehaviors() {
 		$model = TableRegistry::get('NumberTrees');
 		$result = $this->Task->getBehaviors($model);
-		$this->assertEquals(['Tree' => ''], $result);
+		$this->assertEquals(['Tree' => []], $result);
 
 		$model = TableRegistry::get('BakeArticles');
 		$result = $this->Task->getBehaviors($model);
-		$this->assertEquals(['Timestamp' => ''], $result);
+		$this->assertEquals(['Timestamp' => []], $result);
 
 		$model = TableRegistry::get('CounterCacheUsers');
 		$result = $this->Task->getBehaviors($model);