Skip to content
Permalink
Browse files

PHPCS fixes and doc block corrections.

  • Loading branch information...
markstory committed Oct 29, 2015
1 parent 485475c commit 54ffe6449e4051712679c14b6a940d32922037ea
@@ -139,7 +139,7 @@ protected function _processAssociation(Event $event, EntityInterface $entity, As
$countConditions = $entity->extract($foreignKeys);
$updateConditions = array_combine($primaryKeys, $countConditions);
$countOriginalConditions = $entity->extractOriginalChanged($foreignKeys);
if ($countOriginalConditions !== []) {
$updateOriginalConditions = array_combine($primaryKeys, $countOriginalConditions);
}
@@ -9,16 +9,15 @@
*
* @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;
use Cake\TestSuite\Fixture\TestFixture;
/**
* Short description for class.
*
* CounterCache test fixture for testing binding keys.
*/
class CounterCacheUserCategoryPostsFixture extends TestFixture
{
@@ -80,7 +80,7 @@ public function setUp()
'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 @@ public function testMultiple()
$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 @@ public function testBindingKey()
'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'));
}

0 comments on commit 54ffe64

Please sign in to comment.
You can’t perform that action at this time.