PhpUnitApiGetTestClassesTest and PhpUnitApiFindAllClassFilesTest need to execute PHPUnit discovery before TestDiscovery

Created on 25 May 2025, 8 days ago

Problem/Motivation

Found a bug introduced by 📌 Deprecate TestDiscovery test file scanning, use PHPUnit API instead Active : PHPUnit's test discovery uses diffs between declared classes to identify if a test class is present in the scanned file.

This works as long as the file is loaded to PHP for the first time.

Apparently in some cases the legacy TestDiscovery, whose results the tests compare to PHPUnit's, load the classes too, before PHPUnit that in this case complains about a supposedly missing test class in the file.

Proposed resolution

Just swap the sequence of discovery in the tests - run first PHPUnit's then legacy TestDiscovery before comparing, instead of the other way round as in HEAD right now.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

phpunit

Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024