Skip to content

chore: add test:unit:filter and test:integration:filter scripts - #5181

Merged
imorland merged 1 commit into
2.xfrom
im/test-filter-scripts
Oct 12, 2026
Merged

imorland merged 1 commit into
2.xfrom
im/test-filter-scripts

Conversation

@imorland

@imorland imorland commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Fixes: no issue.

Changes proposed in this pull request:
Running one test class meant either the whole suite (core's integration suite is over 1,000 tests and takes several minutes) or calling PHPUnit by hand with --filter. This adds test:unit:filter and test:integration:filter to core and to every bundled extension with tests, used as composer test:integration:filter -- ClassName (or a method name, or 'ClassA|ClassB'). messages, mentions and suspend already had the integration one; it is moved next to test:integration, so every package lists the scripts in the same order.

New extensions get the same scripts from the CLI in flarum/cli#63, and the testing guide documents them in flarum/docs#664.

Reviewers should focus on:

  • Scripts only: 19 composer.json files, nothing else changed in them.

Screenshot
N/A

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered? (N/A)
  • For core PRs, does this need to be in core, or could it be in an extension? (N/A, dev scripts.)
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation. (No frontend changes.)
  • Frontend changes: tests are green (run yarn test in js/). (No frontend changes.)
  • Frontend changes: tests have been added, or are not appropriate here. (No frontend changes.)
  • Backend changes: tests are green (run composer test). (No code changes; ran test:unit:filter in core and test:integration:filter in sticky.)
  • Backend changes: tests have been added, or are not appropriate here. (No code changes.)
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite). (N/A)
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

Every package with tests can now run one class or method through its
composer scripts: composer test:integration:filter -- ClassName. The
integration filter messages, mentions and suspend already had is moved
next to test:integration, so all packages list the scripts in one order.
@imorland
imorland requested a review from a team as a code owner October 12, 2026 10:49
@imorland imorland added this to the 2.0.1 milestone Oct 12, 2026
@imorland
imorland merged commit f59d33b into 2.x Oct 12, 2026
30 checks passed
@imorland
imorland deleted the im/test-filter-scripts branch October 12, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant