Skip to content

Bump phpunit to ^12.5 and adapt tests for PHPUnit 12 - #18

Open
somework wants to merge 1 commit into
masterfrom
codex/bump-phpunit-to-version-12.5
Open

Bump phpunit to ^12.5 and adapt tests for PHPUnit 12#18
somework wants to merge 1 commit into
masterfrom
codex/bump-phpunit-to-version-12.5

Conversation

@somework

@somework somework commented Jan 26, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Upgrade the project to PHPUnit 12.5 to stay current with testing tools and PHP versions.
  • Make tests compatible with PHPUnit 12 API changes (mock method helpers and attributes).

Description

  • Updated composer.json to require-dev phpunit/phpunit ^12.5.
  • Ran composer update phpunit/phpunit -W to refresh the lockfile and upgrade related packages.
  • Replaced legacy mock return syntax in tests by using willReturn(...) in DataChunkTest and HeaderChunkTest.
  • Migrated docblock @dataProvider and @depends annotations to PHPUnit 12 attributes (#[DataProvider(...)], #[Depends(...)]) and added the attribute imports in AddUserToListTest.

Testing

  • Ran composer update phpunit/phpunit -W which completed and upgraded PHPUnit and related packages successfully.
  • Ran the test suite with vendor/bin/phpunit; initially the suite failed with 4 errors, and after test fixes the suite passed: OK (67 tests, 121 assertions).

Codex Task

Summary by CodeRabbit

  • Chores
    • Updated PHPUnit development dependency to a newer version
    • Modernized test infrastructure to use updated syntax conventions

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 26, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

PHPUnit dependency upgraded from version ^10.5 to ^12.5 in composer.json. Test files updated to use PHPUnit 12-compatible syntax: mock expectations simplified to willReturn() format and Javadoc annotations converted to PHP 8 attributes.

Changes

Cohort / File(s) Summary
Dependency Management
composer.json
PHPUnit require-dev version bumped from ^10.5 to ^12.5
Mock Syntax Updates
tests/LinguaLeo/ExpertSender/Chunks/DataChunkTest.php, tests/LinguaLeo/ExpertSender/Chunks/HeaderChunkTest.php
Mock expectations refactored from will($this->returnValue(...)) to concise willReturn(...) syntax
PHP 8 Attributes Migration
tests/LinguaLeo/ExpertSender/Request/AddUserToListTest.php
Test annotations converted from Javadoc-style comments (@dataProvider, @depends) to PHP 8 attributes (#[DataProvider], #[Depends])

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hopping through tests with a PHPUnit cheer,
Version twelve arrives with modernization here,
Mock syntax simplified, attributes so keen,
Your test suite now gleams in bright PHP green! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: upgrading PHPUnit to version 12.5 and updating tests to be compatible with PHPUnit 12 API changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant