Browse Source

improve test coverage

ADmad 1 year ago
parent
commit
63a8a88dec
1 changed files with 4 additions and 0 deletions
  1. 4 0
      tests/TestCase/ORM/Behavior/CounterCacheBehaviorTest.php

+ 4 - 0
tests/TestCase/ORM/Behavior/CounterCacheBehaviorTest.php

@@ -23,6 +23,7 @@ use Cake\Event\EventInterface;
 use Cake\ORM\Entity;
 use Cake\ORM\Table;
 use Cake\TestSuite\TestCase;
+use Exception;
 use TestApp\Model\Table\PublishedPostsTable;
 
 /**
@@ -626,6 +627,9 @@ class CounterCacheBehaviorTest extends TestCase
         $this->post->addBehavior('CounterCache', [
             'Users' => [
                 'post_count',
+                'dummy' => function () {
+                    throw new Exception('Closures are never called by "updateCounterCache()"');
+                },
             ],
         ]);