From 585c81572191098b58c8781439e3566ef7d8bf92 Mon Sep 17 00:00:00 2001 From: ADmad Date: Wed, 22 Oct 2025 13:46:09 +0530 Subject: [PATCH 1/7] Fix CI errors --- .phive/phars.xml | 2 +- phpcs.xml.dist | 4 +++- tests/bootstrap.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.phive/phars.xml b/.phive/phars.xml index f5aa330..a95d33f 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,4 +1,4 @@ - + diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 3edb1fc..0f8d406 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,7 +1,9 @@ - + src/ + tests/ + tests/comparisons/* diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 75c23fd..ecf4710 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -55,9 +55,9 @@ // phpcs:enable Cache::setConfig([ - '_cake_core_' => [ + '_cake_translations_' => [ 'engine' => 'File', - 'prefix' => 'cake_core_', + 'prefix' => '_cake_translations_', 'serialize' => true, ], '_cake_model_' => [ From 66d9ae4d367efe2a35aaa6ac9548ed1cd4d982a0 Mon Sep 17 00:00:00 2001 From: ADmad Date: Wed, 22 Oct 2025 13:50:54 +0530 Subject: [PATCH 2/7] Allow higher phpunit versions --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 410e2e3..2d8bfe5 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cakephp/bake": "^3.0.0", "cakephp/cakephp-codesniffer": "^5.0", "enqueue/fs": "^0.10", - "phpunit/phpunit": "^10.1.0" + "phpunit/phpunit": "^10.1.0 || ^11.1.3 || ^12.0.9" }, "suggest": { "cakephp/bake": "Required if you want to generate jobs.", From d75a4c3c6adbd950c77c8b6da4bee6bbdf298cbd Mon Sep 17 00:00:00 2001 From: Jasper Smet Date: Wed, 22 Oct 2025 11:11:15 +0200 Subject: [PATCH 3/7] Fix tests - Update tests to be compatible with phpunit 11/12 - Implement QueueMananger::configured() to allow easier lookup and thus also teardowns in tests - Conslidated DebugLogTrait into new QueueTestTrait - Bump min phpunit to 10.5.32 --- composer.json | 2 +- src/QueueManager.php | 10 ++ tests/TestCase/Command/RequeueCommandTest.php | 4 +- tests/TestCase/Command/WorkerCommandTest.php | 57 ++++----- .../LimitAttemptsExtensionTest.php | 14 +-- ...emoveUniqueJobIdFromCacheExtensionTest.php | 18 +-- tests/TestCase/DebugLogTrait.php | 36 ------ .../Listener/FailedJobsListenerTest.php | 14 +-- tests/TestCase/Mailer/QueueTraitTest.php | 8 +- .../Mailer/Transport/QueueTransportTest.php | 3 + tests/TestCase/Queue/ProcessorTest.php | 7 +- tests/TestCase/QueueManagerTest.php | 3 +- tests/TestCase/QueueTestTrait.php | 116 ++++++++++++++++++ 13 files changed, 177 insertions(+), 115 deletions(-) delete mode 100644 tests/TestCase/DebugLogTrait.php create mode 100644 tests/TestCase/QueueTestTrait.php diff --git a/composer.json b/composer.json index 2d8bfe5..13f8fe7 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "cakephp/bake": "^3.0.0", "cakephp/cakephp-codesniffer": "^5.0", "enqueue/fs": "^0.10", - "phpunit/phpunit": "^10.1.0 || ^11.1.3 || ^12.0.9" + "phpunit/phpunit": "^10.5.32 || ^11.1.3 || ^12.0.9" }, "suggest": { "cakephp/bake": "Required if you want to generate jobs.", diff --git a/src/QueueManager.php b/src/QueueManager.php index aac4739..32cd914 100644 --- a/src/QueueManager.php +++ b/src/QueueManager.php @@ -147,6 +147,16 @@ public static function getConfig(string $key): mixed return static::$_config[$key] ?? null; } + /** + * Get the configured queue keys. + * + * @return array List of configured queue configuration keys. + */ + public static function configured(): array + { + return array_keys(static::$_config); + } + /** * Remove a configured queue adapter. * diff --git a/tests/TestCase/Command/RequeueCommandTest.php b/tests/TestCase/Command/RequeueCommandTest.php index 51929d5..480b9e9 100644 --- a/tests/TestCase/Command/RequeueCommandTest.php +++ b/tests/TestCase/Command/RequeueCommandTest.php @@ -20,7 +20,7 @@ use Cake\Core\Configure; use Cake\Log\Log; use Cake\Queue\QueueManager; -use Cake\Queue\Test\TestCase\DebugLogTrait; +use Cake\Queue\Test\TestCase\QueueTestTrait; use Cake\TestSuite\TestCase; use TestApp\Job\LogToDebugJob; @@ -32,7 +32,7 @@ class RequeueCommandTest extends TestCase { use ConsoleIntegrationTestTrait; - use DebugLogTrait; + use QueueTestTrait; protected array $fixtures = [ 'plugin.Cake/Queue.FailedJobs', diff --git a/tests/TestCase/Command/WorkerCommandTest.php b/tests/TestCase/Command/WorkerCommandTest.php index 5eb1623..297fca6 100644 --- a/tests/TestCase/Command/WorkerCommandTest.php +++ b/tests/TestCase/Command/WorkerCommandTest.php @@ -14,6 +14,7 @@ * @since 0.1.0 * @license https://opensource.org/licenses/MIT MIT License */ + namespace Cake\Queue\Test\TestCase\Command; use Cake\Console\TestSuite\ConsoleIntegrationTestTrait; @@ -22,8 +23,10 @@ use Cake\Queue\QueueManager; use Cake\Queue\Test\test_app\src\Job\LogToDebugWithServiceJob; use Cake\Queue\Test\test_app\src\Queue\TestCustomProcessor; -use Cake\Queue\Test\TestCase\DebugLogTrait; +use Cake\Queue\Test\TestCase\QueueTestTrait; use Cake\TestSuite\TestCase; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use TestApp\Job\LogToDebugJob; use TestApp\Job\RequeueJob; use TestApp\WelcomeMailerListener; @@ -36,7 +39,7 @@ class WorkerCommandTest extends TestCase { use ConsoleIntegrationTestTrait; - use DebugLogTrait; + use QueueTestTrait; /** * Test that command description prints out @@ -49,9 +52,8 @@ public function testDescriptionOutput() /** * Test that queue will run for one second - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueProcessesStart() { Configure::write('Queue', [ @@ -66,9 +68,8 @@ public function testQueueProcessesStart() /** * Test that queue will run for one second with valid listener - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueProcessesWithListener() { Configure::write('Queue', [ @@ -84,9 +85,8 @@ public function testQueueProcessesWithListener() /** * Test that queue will abort when the passed config is not present in the app configuration. - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueWillAbortWithMissingConfig() { Configure::write('Queue', [ @@ -103,9 +103,8 @@ public function testQueueWillAbortWithMissingConfig() /** * Test that queue will abort with invalid listener - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueProcessesWithInvalidListener() { Configure::write('Queue', [ @@ -122,9 +121,8 @@ public function testQueueProcessesWithInvalidListener() /** * Test that queue will write to specified logger option - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueProcessesWithLogger() { Configure::write('Queue', [ @@ -157,10 +155,9 @@ public static function dataProviderCallableTypes(): array /** * Start up the worker queue, push a job, and see that it processes - * - * @dataProvider dataProviderCallableTypes - * @runInSeparateProcess */ + #[RunInSeparateProcess] + #[DataProvider('dataProviderCallableTypes')] public function testQueueProcessesJob($callable) { $config = [ @@ -186,9 +183,8 @@ public function testQueueProcessesJob($callable) /** * Set the processor name, Start up the worker queue, push a job, and see that it processes - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueProcessesJobWithProcessor() { $config = [ @@ -213,9 +209,8 @@ public function testQueueProcessesJobWithProcessor() /** * Test non-default queue name - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueProcessesJobWithOtherQueue() { $config = [ @@ -241,9 +236,8 @@ public function testQueueProcessesJobWithOtherQueue() /** * Test max-attempts option - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueProcessesJobWithMaxAttempts() { $config = [ @@ -269,9 +263,8 @@ public function testQueueProcessesJobWithMaxAttempts() /** * Test DI service injection works in tasks - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueProcessesJobWithDIService() { $this->skipIf(version_compare(Configure::version(), '4.2', '<'), 'DI Container is only available since CakePHP 4.2'); @@ -297,9 +290,8 @@ public function testQueueProcessesJobWithDIService() /** * Test that queue will process when a unique cache is configured. - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueProcessesWithUniqueCacheConfigured() { $config = [ @@ -324,9 +316,8 @@ public function testQueueProcessesWithUniqueCacheConfigured() /** * Test that queue uses default processor when no processor is specified. - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueUsesDefaultProcessor() { $config = [ @@ -352,9 +343,8 @@ public function testQueueUsesDefaultProcessor() /** * Test that queue uses custom processor when specified in configuration. - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueUsesCustomProcessor() { $config = [ @@ -383,9 +373,8 @@ public function testQueueUsesCustomProcessor() /** * Test that queue aborts when custom processor class does not exist. - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueAbortsWithNonExistentProcessor() { $config = [ @@ -403,9 +392,8 @@ public function testQueueAbortsWithNonExistentProcessor() /** * Test that queue aborts when custom processor does not implement Interop\Queue\Processor. - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testQueueAbortsWithInvalidProcessor() { $config = [ @@ -423,9 +411,8 @@ public function testQueueAbortsWithInvalidProcessor() /** * Test that custom processor works with listener configuration. - * - * @runInSeparateProcess */ + #[RunInSeparateProcess] public function testCustomProcessorWithListener() { $config = [ diff --git a/tests/TestCase/Consumption/LimitAttemptsExtensionTest.php b/tests/TestCase/Consumption/LimitAttemptsExtensionTest.php index 7094d47..70ec9ab 100644 --- a/tests/TestCase/Consumption/LimitAttemptsExtensionTest.php +++ b/tests/TestCase/Consumption/LimitAttemptsExtensionTest.php @@ -10,7 +10,7 @@ use Cake\Queue\Consumption\LimitConsumedMessagesExtension; use Cake\Queue\Queue\Processor as QueueProcessor; use Cake\Queue\QueueManager; -use Cake\Queue\Test\TestCase\DebugLogTrait; +use Cake\Queue\Test\TestCase\QueueTestTrait; use Cake\TestSuite\TestCase; use Enqueue\Consumption\ChainExtension; use Psr\Log\NullLogger; @@ -19,7 +19,7 @@ class LimitAttemptsExtensionTest extends TestCase { - use DebugLogTrait; + use QueueTestTrait; public function setUp(): void { @@ -28,16 +28,6 @@ public function setUp(): void EventManager::instance()->setEventList(new EventList()); } - /** - * @beforeClass - * @after - */ - public static function dropConfigs() - { - Log::drop('debug'); - QueueManager::drop('default'); - } - public function testMessageShouldBeRequeuedIfMaxAttemptsIsNotSet() { $consume = $this->setupQueue(); diff --git a/tests/TestCase/Consumption/RemoveUniqueJobIdFromCacheExtensionTest.php b/tests/TestCase/Consumption/RemoveUniqueJobIdFromCacheExtensionTest.php index 9d09e2a..ff8be08 100644 --- a/tests/TestCase/Consumption/RemoveUniqueJobIdFromCacheExtensionTest.php +++ b/tests/TestCase/Consumption/RemoveUniqueJobIdFromCacheExtensionTest.php @@ -9,6 +9,7 @@ use Cake\Queue\Consumption\RemoveUniqueJobIdFromCacheExtension; use Cake\Queue\Queue\Processor as QueueProcessor; use Cake\Queue\QueueManager; +use Cake\Queue\Test\TestCase\QueueTestTrait; use Cake\TestSuite\TestCase; use Enqueue\Consumption\ChainExtension; use Psr\Log\NullLogger; @@ -16,22 +17,7 @@ class RemoveUniqueJobIdFromCacheExtensionTest extends TestCase { - /** - * @beforeClass - * @after - */ - public static function dropConfigs() - { - Log::drop('debug'); - - QueueManager::drop('default'); - - $cacheKey = QueueManager::getConfig('default')['uniqueCacheKey'] ?? null; - if ($cacheKey) { - Cache::clear($cacheKey); - Cache::drop($cacheKey); - } - } + use QueueTestTrait; public function testJobIsRemovedFromCacheAfterProcessing() { diff --git a/tests/TestCase/DebugLogTrait.php b/tests/TestCase/DebugLogTrait.php deleted file mode 100644 index e50006d..0000000 --- a/tests/TestCase/DebugLogTrait.php +++ /dev/null @@ -1,36 +0,0 @@ -debugLogCount($expected); - - $this->assertGreaterThanOrEqual(1, $found, "Did not find `{$expected}` in logs."); - } - - protected function assertDebugLogContainsExactly($expected, $times): void - { - $found = $this->debugLogCount($expected); - - $this->assertSame($times, $found, "Did not find `{$expected}` exactly {$times} times in logs."); - } - - protected function debugLogCount($seach) - { - $log = Log::engine('debug'); - $found = 0; - foreach ($log->read() as $line) { - if (strpos($line, $seach) !== false) { - $found++; - } - } - - return $found; - } -} diff --git a/tests/TestCase/Listener/FailedJobsListenerTest.php b/tests/TestCase/Listener/FailedJobsListenerTest.php index 9a9a71c..ab181a0 100644 --- a/tests/TestCase/Listener/FailedJobsListenerTest.php +++ b/tests/TestCase/Listener/FailedJobsListenerTest.php @@ -14,6 +14,7 @@ * @since 0.1.0 * @license https://opensource.org/licenses/MIT MIT License */ + namespace Cake\Queue\Test\TestCase\Mailer; use Cake\Event\Event; @@ -25,15 +26,19 @@ use Cake\Queue\Listener\FailedJobsListener; use Cake\Queue\Model\Table\FailedJobsTable; use Cake\Queue\QueueManager; +use Cake\Queue\Test\TestCase\QueueTestTrait; use Cake\TestSuite\TestCase; use Enqueue\Null\NullConnectionFactory; use Enqueue\Null\NullMessage; +use PHPUnit\Framework\Attributes\DataProvider; use RuntimeException; use stdClass; use TestApp\Job\LogToDebugJob; class FailedJobsListenerTest extends TestCase { + use QueueTestTrait; + protected array $fixtures = [ 'plugin.Cake/Queue.FailedJobs', ]; @@ -48,13 +53,6 @@ public function setUp(): void ]); } - public function tearDown(): void - { - parent::tearDown(); - - QueueManager::drop('example_config'); - } - public function testFailedJobIsAddedWhenEventIsFired() { $parsedBody = [ @@ -113,9 +111,9 @@ public static function storeFailedJobExceptionDataProvider() } /** - * @dataProvider storeFailedJobExceptionDataProvider * @return void */ + #[DataProvider('storeFailedJobExceptionDataProvider')] public function testStoreFailedJobException($eventData, $exceptionMessage) { $tableLocator = $this diff --git a/tests/TestCase/Mailer/QueueTraitTest.php b/tests/TestCase/Mailer/QueueTraitTest.php index 93d067b..df5f241 100644 --- a/tests/TestCase/Mailer/QueueTraitTest.php +++ b/tests/TestCase/Mailer/QueueTraitTest.php @@ -18,11 +18,15 @@ use Cake\Mailer\Exception\MissingActionException; use Cake\Queue\QueueManager; +use Cake\Queue\Test\TestCase\QueueTestTrait; use Cake\TestSuite\TestCase; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use TestApp\WelcomeMailer; class QueueTraitTest extends TestCase { + use QueueTestTrait; + /** * Test that a MissingActionException is being thrown when * the push action is not found on the object with the QueueTrait @@ -38,10 +42,8 @@ public function testQueueTraitTestThrowsMissingActionException() /** * Test that QueueTrait calls push - * - * @runInSeparateProcess - * @return @void */ + #[RunInSeparateProcess] public function testQueueTraitCallsPush() { $queue = new WelcomeMailer(); diff --git a/tests/TestCase/Mailer/Transport/QueueTransportTest.php b/tests/TestCase/Mailer/Transport/QueueTransportTest.php index 61ff9a5..7da8041 100644 --- a/tests/TestCase/Mailer/Transport/QueueTransportTest.php +++ b/tests/TestCase/Mailer/Transport/QueueTransportTest.php @@ -20,10 +20,13 @@ use Cake\Mailer\Transport\SmtpTransport; use Cake\Queue\Mailer\Transport\QueueTransport; use Cake\Queue\QueueManager; +use Cake\Queue\Test\TestCase\QueueTestTrait; use Cake\TestSuite\TestCase; class QueueTransportTest extends TestCase { + use QueueTestTrait; + private $fsQueuePath = TMP . DS . 'queue'; private function getFsQueueUrl(): string diff --git a/tests/TestCase/Queue/ProcessorTest.php b/tests/TestCase/Queue/ProcessorTest.php index 0da6b9c..c2eccf9 100644 --- a/tests/TestCase/Queue/ProcessorTest.php +++ b/tests/TestCase/Queue/ProcessorTest.php @@ -14,6 +14,7 @@ * @since 0.1.0 * @license https://opensource.org/licenses/MIT MIT License */ + namespace Cake\Queue\Test\TestCase\Queue; use Cake\Event\EventList; @@ -21,14 +22,18 @@ use Cake\Log\Log; use Cake\Queue\Job\Message; use Cake\Queue\Queue\Processor; +use Cake\Queue\Test\TestCase\QueueTestTrait; use Cake\TestSuite\TestCase; use Enqueue\Null\NullConnectionFactory; use Enqueue\Null\NullMessage; use Interop\Queue\Processor as InteropProcessor; +use PHPUnit\Framework\Attributes\DataProvider; use TestApp\TestProcessor; class ProcessorTest extends TestCase { + use QueueTestTrait; + public static $lastProcessMessage; /** @@ -54,9 +59,9 @@ public static function dataProviderTestProcess(): array * @param string $expected The expected process result. * @param string $logMessage The log message based on process result. * @param string $dispacthedEvent The dispatched event based on process result. - * @dataProvider dataProviderTestProcess * @return void */ + #[DataProvider('dataProviderTestProcess')] public function testProcess($jobMethod, $expected, $logMessage, $dispatchedEvent) { $messageBody = [ diff --git a/tests/TestCase/QueueManagerTest.php b/tests/TestCase/QueueManagerTest.php index ba3bdc6..04576a0 100644 --- a/tests/TestCase/QueueManagerTest.php +++ b/tests/TestCase/QueueManagerTest.php @@ -14,6 +14,7 @@ * @since 0.1.0 * @license https://www.opensource.org/licenses/mit-license.php MIT License */ + namespace Cake\Queue\Test\TestCase; use BadMethodCallException; @@ -32,7 +33,7 @@ */ class QueueManagerTest extends TestCase { - use DebugLogTrait; + use QueueTestTrait; private $fsQueuePath = TMP . DS . 'queue'; diff --git a/tests/TestCase/QueueTestTrait.php b/tests/TestCase/QueueTestTrait.php new file mode 100644 index 0000000..2f697eb --- /dev/null +++ b/tests/TestCase/QueueTestTrait.php @@ -0,0 +1,116 @@ + + */ +trait QueueTestTrait +{ + /** + * Clean up QueueManager, Cache, and Log configurations after each test + * + * This is automatically called after each test via the #[After] attribute. + * It drops all QueueManager configs and their associated cache configs, + * and resets all log configurations. + * + * @return void + */ + #[After] + public function cleanupQueueManagerConfigs(): void + { + // Drop all QueueManager configurations and their associated caches + foreach (QueueManager::configured() as $config) { + // Drop associated cache config if it exists + $queueConfig = QueueManager::getConfig($config); + if ($queueConfig && isset($queueConfig['uniqueCacheKey'])) { + $cacheKey = $queueConfig['uniqueCacheKey']; + if (Cache::configured($cacheKey)) { + Cache::drop($cacheKey); + } + } + + QueueManager::drop($config); + } + + // Reset log configurations + Log::reset(); + } + + /** + * Assert that a message was found in debug logs + * + * @param string $expected The message to search for in logs + * @return void + */ + protected function assertDebugLogContains($expected): void + { + $found = $this->debugLogCount($expected); + + $this->assertGreaterThanOrEqual(1, $found, "Did not find `{$expected}` in logs."); + } + + /** + * Assert that a message was found exactly N times in debug logs + * + * @param string $expected The message to search for in logs + * @param int $times The exact number of times the message should appear + * @return void + */ + protected function assertDebugLogContainsExactly($expected, $times): void + { + $found = $this->debugLogCount($expected); + + $this->assertSame($times, $found, "Did not find `{$expected}` exactly {$times} times in logs."); + } + + /** + * Count occurrences of a message in debug logs + * + * @param string $search The message to search for + * @return int The number of times the message was found + */ + protected function debugLogCount($search) + { + $log = Log::engine('debug'); + $found = 0; + foreach ($log->read() as $line) { + if (strpos($line, $search) !== false) { + $found++; + } + } + + return $found; + } +} From 6ca40e1390c348e1a54e7574d0e36448aefe8361 Mon Sep 17 00:00:00 2001 From: Jasper Smet Date: Wed, 22 Oct 2025 13:56:18 +0200 Subject: [PATCH 4/7] add twig-view constraint: fixes twig complitation errors on twig <= 3.4.0 --- composer.json | 1 + templates/bake/job.twig | 20 ++++++++++---------- tests/bootstrap.php | 6 +++++- tests/comparisons/JobTaskWithMaxAttempts.php | 2 +- tests/comparisons/JobTaskWithUnique.php | 2 +- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 13f8fe7..b7a7a3a 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "psr/log": "^3.0" }, "require-dev": { + "cakephp/twig-view": "^2.0.2", "cakephp/bake": "^3.0.0", "cakephp/cakephp-codesniffer": "^5.0", "enqueue/fs": "^0.10", diff --git a/templates/bake/job.twig b/templates/bake/job.twig index 3a4705b..7dc6873 100644 --- a/templates/bake/job.twig +++ b/templates/bake/job.twig @@ -13,14 +13,14 @@ * @license https://opensource.org/licenses/MIT MIT License */ #} - [ + $cache_key => [ 'engine' => 'File', 'prefix' => '_cake_translations_', 'serialize' => true, diff --git a/tests/comparisons/JobTaskWithMaxAttempts.php b/tests/comparisons/JobTaskWithMaxAttempts.php index 99c4f4e..d8f4c91 100644 --- a/tests/comparisons/JobTaskWithMaxAttempts.php +++ b/tests/comparisons/JobTaskWithMaxAttempts.php @@ -14,7 +14,7 @@ class UploadJob implements JobInterface { /** * The maximum number of times the job may be attempted. - * + * * @var int|null */ public static $maxAttempts = 3; diff --git a/tests/comparisons/JobTaskWithUnique.php b/tests/comparisons/JobTaskWithUnique.php index cae4020..f0faf36 100644 --- a/tests/comparisons/JobTaskWithUnique.php +++ b/tests/comparisons/JobTaskWithUnique.php @@ -14,7 +14,7 @@ class UploadJob implements JobInterface { /** * Whether there should be only one instance of a job on the queue at a time. (optional property) - * + * * @var bool */ public static $shouldBeUnique = true; From 4f91cce3f2100e47eecc485d9631dd383eba96d2 Mon Sep 17 00:00:00 2001 From: Jasper Smet Date: Thu, 23 Oct 2025 10:06:00 +0200 Subject: [PATCH 5/7] Bump bake requirement to to 3.5.1 --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b7a7a3a..5557843 100644 --- a/composer.json +++ b/composer.json @@ -27,11 +27,10 @@ "psr/log": "^3.0" }, "require-dev": { - "cakephp/twig-view": "^2.0.2", - "cakephp/bake": "^3.0.0", + "cakephp/bake": "^3.5.1", "cakephp/cakephp-codesniffer": "^5.0", "enqueue/fs": "^0.10", - "phpunit/phpunit": "^10.5.32 || ^11.1.3 || ^12.0.9" + "phpunit/phpunit": "^10.5.32 || ^11.3.3 || ^12.0.9" }, "suggest": { "cakephp/bake": "Required if you want to generate jobs.", From 1f174887532958ac27289e8dc8aa3cb269f23bb2 Mon Sep 17 00:00:00 2001 From: Jasper Smet Date: Thu, 23 Oct 2025 10:19:19 +0200 Subject: [PATCH 6/7] Clean up docblock --- tests/TestCase/QueueTestTrait.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/TestCase/QueueTestTrait.php b/tests/TestCase/QueueTestTrait.php index 2f697eb..c056223 100644 --- a/tests/TestCase/QueueTestTrait.php +++ b/tests/TestCase/QueueTestTrait.php @@ -28,13 +28,6 @@ * Provides: * - Configuration cleanup for QueueManager, Cache, and Log * - Debug log assertion helpers - * - * Usage in your test class: - * - * ```php - * use QueueTestTrait; - * ``` - */ trait QueueTestTrait { From 8c31f735f059e220ecc7db2e7e09224ab1322a1c Mon Sep 17 00:00:00 2001 From: Jasper Smet Date: Thu, 23 Oct 2025 10:40:06 +0200 Subject: [PATCH 7/7] Bump cake to 5.1.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5557843..c9d1609 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "require": { "php": ">=8.1", - "cakephp/cakephp": "^5.0.0", + "cakephp/cakephp": "^5.1.0", "enqueue/simple-client": "^0.10", "psr/log": "^3.0" },