Browse Source

PHPCS fixes and doc block corrections.

Mark Story 10 years ago
parent
commit
54ffe6449e

+ 1 - 1
src/ORM/Behavior/CounterCacheBehavior.php

@@ -139,7 +139,7 @@ class CounterCacheBehavior extends Behavior
         $countConditions = $entity->extract($foreignKeys);
         $updateConditions = array_combine($primaryKeys, $countConditions);
         $countOriginalConditions = $entity->extractOriginalChanged($foreignKeys);
-        
+
         if ($countOriginalConditions !== []) {
             $updateOriginalConditions = array_combine($primaryKeys, $countOriginalConditions);
         }

+ 2 - 3
tests/Fixture/CounterCacheUserCategoryPostsFixture.php

@@ -9,7 +9,7 @@
  *
  * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  * @link          http://cakephp.org CakePHP(tm) Project
- * @since         1.2.0
+ * @since         3.1.4
  * @license       http://www.opensource.org/licenses/mit-license.php MIT License
  */
 namespace Cake\Test\Fixture;
@@ -17,8 +17,7 @@ namespace Cake\Test\Fixture;
 use Cake\TestSuite\Fixture\TestFixture;
 
 /**
- * Short description for class.
- *
+ * CounterCache test fixture for testing binding keys.
  */
 class CounterCacheUserCategoryPostsFixture extends TestFixture
 {

+ 7 - 7
tests/TestCase/ORM/Behavior/CounterCacheBehaviorTest.php

@@ -80,7 +80,7 @@ class CounterCacheBehaviorTest extends TestCase
             'connection' => $this->connection
         ]);
 
-        $this->user_category_posts = new Table([
+        $this->userCategoryPosts = new Table([
             'alias' => 'UserCategoryPosts',
             'table' => 'counter_cache_user_category_posts',
             'connection' => $this->connection
@@ -372,7 +372,7 @@ class CounterCacheBehaviorTest extends TestCase
         $this->assertEquals(2, $before->get('post_count'));
         $this->assertEquals(3, $after->get('post_count'));
     }
-    
+
     /**
      * Tests to see that the binding key configuration is respected.
      *
@@ -384,20 +384,20 @@ class CounterCacheBehaviorTest extends TestCase
             'bindingKey' => ['category_id', 'user_id'],
             'foreignKey' => ['category_id', 'user_id']
         ]);
-        $this->post->association('UserCategoryPosts')->target($this->user_category_posts);
+        $this->post->association('UserCategoryPosts')->target($this->userCategoryPosts);
         $this->post->addBehavior('CounterCache', [
             'UserCategoryPosts' => ['post_count']
         ]);
-        
-        $before = $this->user_category_posts->find()
+
+        $before = $this->userCategoryPosts->find()
             ->where(['user_id' => 1, 'category_id' => 2])
             ->first();
         $entity = $this->_getEntity()->set('category_id', 2);
         $this->post->save($entity);
-        $after = $this->user_category_posts->find()
+        $after = $this->userCategoryPosts->find()
             ->where(['user_id' => 1, 'category_id' => 2])
             ->first();
-        
+
         $this->assertEquals(1, $before->get('post_count'));
         $this->assertEquals(2, $after->get('post_count'));
     }