Skip to content

Conversation

@josbeir
Copy link
Contributor

@josbeir josbeir commented Jan 22, 2026

Summary

This PR fixes deprecation warnings, PHPUnit notices, and PHPStan errors in the test suite.

Changes

  • Replace getMockBuilder()->...->getMock() with createStub() in PluginTest.php
  • Add backwards-compatible eventListToArray() helper to fix CakePHP 5.3.0 EventList array access deprecation
  • Remove unused static property $lastProcessMessage
  • Fix PHPDoc typo $dispacthedEvent$dispatchedEvent
  • Add type hints to testProcess() method parameters
  • Cast json_encode() to (string) to satisfy PHPStan
  • Add @var annotations for EventManager and ArrayLog type narrowing
  • Replace assertNotEmpty() with assertInstanceOf() for typed static property

Copilot AI review requested due to automatic review settings January 22, 2026 18:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses technical debt by fixing PHPUnit deprecations, PHPStan type errors, and CakePHP 5.3.0 compatibility issues in the test suite and source code.

Changes:

  • Modernized PHPUnit mock creation using createStub() instead of deprecated getMockBuilder() chain
  • Added backwards-compatible eventListToArray() helper to handle CakePHP 5.3.0+ EventList Traversable implementation
  • Fixed PHPDoc issues including typos and invalid constructor return type annotations
  • Enhanced type safety with method parameter type hints, json_encode casts, and type narrowing annotations

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/TestCase/QueueManagerTest.php Removed redundant null parameter from setConfig test to properly test exception handling
tests/TestCase/Queue/ProcessorTest.php Added EventList compatibility helper, fixed typo, added type hints, casts, and improved assertions
tests/TestCase/PluginTest.php Replaced deprecated getMockBuilder with createStub for Application mock
src/Consumption/RemoveUniqueJobIdFromCacheExtension.php Removed invalid @return void from constructor PHPDoc
src/Consumption/LimitConsumedMessagesExtension.php Removed invalid @return void from constructor PHPDoc
src/Consumption/LimitAttemptsExtension.php Removed invalid @return void from constructor PHPDoc

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants