Skip to content

Pre-release 4.2.114 → 4.2.113 — task 2.17 step 3: the fork's suite on PHPUnit 11.5 - #86

Merged
agissept merged 1 commit into
masterfrom
pre-release/4.2.114
Oct 1, 2026
Merged

agissept merged 1 commit into
masterfrom
pre-release/4.2.114

Conversation

@oonid

@oonid oonid commented Sep 30, 2026 •

Copy link
Copy Markdown

Task 2.17, step 3 — the fork's suite on PHPUnit 11.5

Stacks on #85. Moves the fork's own test suite from PHPUnit 9.6 to 11.5, the version illuminate/testing v13 targets (11.5 or 12.5). Only require-dev, the test config, tests and the L4\Tests test helper change; nothing an app loads at runtime does.

Changes

  • require-dev: phpunit/phpunit ^11.5 (was ~9.6), mockery/mockery ^1.6 (was ~1.3) and phpspec/prophecy-phpunit ^2.3 (was ~2.0).
  • phpunit.xml: moves to the 11.5 schema, and <coverage> becomes <source>. PHPUnit 10 removed convert*ToExceptions; failOnDeprecation, failOnNotice and failOnWarning replace them, so a PHP warning or deprecation still fails the run.
  • HandlerTest:
    • Its two handleError() tests run with #[WithoutErrorHandler]. While a test runs, PHPUnit 11's own error handler masks error_reporting() down to fatal levels, so the handler under test saw E_USER_ERROR as disabled and threw nothing.
    • The handler itself is unchanged.
  • Attributes: @test doc-comments become #[Test] (doc-comment metadata is deprecated in 11 and removed in 12). getObjectForTrait(), deprecated in 11, becomes an anonymous class.
  • BackwardCompatibleTestCase::getMock(): keeps only the arguments its callers pass (class, methods, constructor arguments). That drops the MockBuilder calls PHPUnit 11 deprecates (enableAutoload, disableProxyingToOriginalMethods, …).

Verification

  • Fork:
    • suite 320 green on PHPUnit 11.5.56, with no deprecations, notices or warnings;
    • ratchet green; composer validate OK;
    • the real composer.json (with rector) resolves: phpunit 11.5.56, mockery 1.6.15, prophecy-phpunit 2.5.0.
  • Downstream: the dicoding app pair dicoding-dev/dicoding#5962 (feature/platform/framework-4.2.114-rc1) moves the app's suites to PHPUnit 11.5 on top of this pin. It ran with vendor installed exactly from its lock and the local SMTP sink on 127.0.0.1:1025:
    • Psalm (full project, no cache): no errors.
    • Unit suite: 8468 green.
    • NotificationV2, CourseCertificate, the mail tests and BeanstalkdQueueBoringTest against a real worker: green.
    • Integration suite: all 2987 tests, run per directory. There are 5 failures, the same 5 as the 4.2.113 pair, and 196 skipped, as there.
    • No test is flagged risky, and there are no PHP deprecations, notices or warnings.
    • The app side needed test fixes for PHPUnit 11: static data providers, an extension in place of the removed TestListener, restoring the handlers each test's app registers, and a tearDown() that tolerates a skip in setUp().
  • Checks ran in a cloud container without deck (PHP 8.4.26, MariaDB 10.11).

Rest of 2.17

  • The app's 9,400 @test doc-comments still work on 11 (with PHPUnit deprecations). Moving them to attributes is the PHPUnit 12 step.
  • Otherwise 2.17 is done on this stack:
    • call() returns TestResponse;
    • the app no longer uses the legacy assertions, and the fork no longer has them;
    • both suites run on PHPUnit 11.

Tag

4.2.114 on f207f827 is not pushed; tag pushes are refused for this session.

🤖 Generated with Claude Code

https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo

Base automatically changed from pre-release/4.2.113 to master October 1, 2026 10:33
Require-dev: phpunit/phpunit ^11.5 (was ~9.6), mockery/mockery ^1.6,
phpspec/prophecy-phpunit ^2.3. illuminate/testing v13 targets PHPUnit
11.5/12.5.

- phpunit.xml moves to the 11.5 schema: <coverage> becomes <source>,
  and the removed convert*ToExceptions options are replaced by
  failOnDeprecation/failOnNotice/failOnWarning, so a PHP warning or
  deprecation still fails the run.
- HandlerTest's two handleError() tests run #[WithoutErrorHandler]:
  PHPUnit 11's error handler masks error_reporting() while a test
  runs, so the handler under test saw E_USER_ERROR as disabled.
- @test doc-comments become #[Test] attributes (doc-comment metadata
  is deprecated in 11 and gone in 12); getObjectForTrait() becomes an
  anonymous class.
- BackwardCompatibleTestCase::getMock() keeps only the arguments its
  callers pass (class, methods, constructor arguments), dropping the
  MockBuilder calls PHPUnit 11 deprecates.

Fork suite: 320 tests green, no deprecations, notices or warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo
@agissept
agissept force-pushed the pre-release/4.2.114 branch from fd37026 to da7764f Compare October 1, 2026 10:33
@agissept
agissept merged commit 2dfda3f into master Oct 1, 2026
2 checks passed
@agissept
agissept deleted the pre-release/4.2.114 branch October 1, 2026 10:33
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.

3 participants