Mark Scherer 10 years ago
parent
commit
fd13502218

+ 2 - 2
src/Model/Behavior/NeighborBehavior.php

@@ -27,8 +27,8 @@ class NeighborBehavior extends Behavior {
 	 * @var array
 	 * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#using-created-and-modified
 	 */
-	protected $_defaultConfig = array(
-	);
+	protected $_defaultConfig = [
+	];
 
 	public function neighbors($id, array $options = []) {
 		if (empty($id)) {

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

@@ -133,7 +133,7 @@ class CommonComponentTest extends TestCase {
 	 * @return void
 	 */
 	public function testPostRedirect() {
-		$is = $this->Controller->Common->postRedirect(array('action' => 'foo'));
+		$is = $this->Controller->Common->postRedirect(['action' => 'foo']);
 		$is = $this->Controller->response->header();
 		$this->assertSame('/foo', $is['Location']);
 		$this->assertSame(302, $this->Controller->response->statusCode());
@@ -145,7 +145,7 @@ class CommonComponentTest extends TestCase {
 	 * @return void
 	 */
 	public function testAutoRedirect() {
-		$is = $this->Controller->Common->autoRedirect(array('action' => 'foo'));
+		$is = $this->Controller->Common->autoRedirect(['action' => 'foo']);
 		$is = $this->Controller->response->header();
 		$this->assertSame('/foo', $is['Location']);
 		$this->assertSame(200, $this->Controller->response->statusCode());
@@ -157,7 +157,7 @@ class CommonComponentTest extends TestCase {
 	 * @return void
 	 */
 	public function testAutoRedirectReferer() {
-		$is = $this->Controller->Common->autoRedirect(array('action' => 'foo'), true);
+		$is = $this->Controller->Common->autoRedirect(['action' => 'foo'], true);
 		$is = $this->Controller->response->header();
 		$this->assertSame('/foo', $is['Location']);
 		$this->assertSame(200, $this->Controller->response->statusCode());

+ 14 - 14
tests/TestCase/Model/Behavior/ConfirmableBehaviorTest.php

@@ -11,7 +11,7 @@ class ConfirmableBehaviorTest extends TestCase {
 
 	public $ConfirmableBehavior;
 
-	public $fixtures = array('plugin.Tools.SluggedArticles');
+	public $fixtures = ['plugin.Tools.SluggedArticles'];
 
 	public function setUp() {
 		parent::setUp();
@@ -28,18 +28,18 @@ class ConfirmableBehaviorTest extends TestCase {
 
 		$animal = $this->Articles->newEntity();
 
-		$data = array(
+		$data = [
 			'name' => 'FooBar',
 			'confirm' => '0'
-		);
+		];
 		$animal = $this->Articles->patchEntity($animal, $data);
 		$this->assertNotEmpty($animal->errors());
-		$this->assertSame(array('confirm' => array('notEmpty' => __d('tools', 'Please confirm the checkbox'))), $animal->errors());
+		$this->assertSame(['confirm' => ['notEmpty' => __d('tools', 'Please confirm the checkbox')]], $animal->errors());
 
-		$data = array(
+		$data = [
 			'name' => 'FooBar',
 			'confirm' => '1'
-		);
+		];
 		$animal = $this->Articles->patchEntity($animal, $data);
 		$this->assertEmpty($animal->errors());
 	}
@@ -68,19 +68,19 @@ class ConfirmableBehaviorTest extends TestCase {
 
 		$animal = $this->Articles->newEntity();
 
-		$data = array(
+		$data = [
 			'name' => 'FooBar',
 			'confirm' => '0'
-		);
+		];
 		$animal = $this->Articles->patchEntity($animal, $data);
 		$this->assertNotEmpty($animal->errors());
 
-		$this->assertSame(array('confirm' => array('notEmpty' => __d('tools', 'Please confirm the checkbox'))), $animal->errors());
+		$this->assertSame(['confirm' => ['notEmpty' => __d('tools', 'Please confirm the checkbox')]], $animal->errors());
 
-		$data = array(
+		$data = [
 			'name' => 'FooBar',
 			'confirm' => '1'
-		);
+		];
 		$animal = $this->Articles->patchEntity($animal, $data);
 		$this->assertEmpty($animal->errors());
 	}
@@ -95,11 +95,11 @@ class ConfirmableBehaviorTest extends TestCase {
 		$this->Articles->addBehavior('Tools.Confirmable');
 
 		$animal = $this->Articles->newEntity();
-		$data = array(
+		$data = [
 			'name' => 'FooBar'
-		);
+		];
 		$animal = $this->Articles->patchEntity($animal, $data);
-		$this->assertSame(array('confirm' => array('_required' => 'This field is required')), $animal->errors());
+		$this->assertSame(['confirm' => ['_required' => 'This field is required']], $animal->errors());
 	}
 
 }

+ 1 - 1
tests/TestCase/Model/Table/TableTest.php

@@ -488,7 +488,7 @@ class TableTest extends TestCase {
 
 		$this->Posts->validator()->add('title', [
 			'validateUnique' => [
-				'rule' => ['validateUniqueExt', ['scope' => array('published')]],
+				'rule' => ['validateUniqueExt', ['scope' => ['published']]],
 				'message' => 'valErrRecordTitleExists',
 				'provider' => 'table'
 			],