Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Layout:
metadata is ignored by PHPUnit, so the plugin reports it and stops honouring it in `TestCaseHandler`.
- `src/Hooks/MissingParentCallHandler.php` and `src/Issue/MissingParentCall.php`: the
`AfterClassLikeAnalysis` hook and plugin issue for `setUp()`-style overrides without a `parent::` call.
- `stubs/TestCase.phpstub`: hides the constructor of `TestCase` (see the stub) and makes `assertNotEmpty()`
- `stubs/TestCase.phpstub`: declares the constructor of `TestCase` (see the stub) and makes `assertNotEmpty()`
narrow its argument.
- `tests/acceptance/*.feature`: the Behat scenarios, the only test suite that CI runs. One file per area
(`DataProviders`, `NamedDatasets`, `Narrowing`, `MockMethod`, ...): add a scenario to the file of the area
Expand Down
5 changes: 3 additions & 2 deletions stubs/TestCase.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
namespace PHPUnit\Framework;

/**
* Without a constructor here, Psalm reports a property that setUp() initializes as MissingConstructor, which
* TestCaseHandler suppresses, rather than as PropertyNotSetInConstructor of TestCase's final constructor.
* Psalm doesn't analyse a stubbed constructor, so it reports a property that a test case leaves uninitialized as
* MissingConstructor, which TestCaseHandler suppresses when setUp() or another initializer sets it.
*/
abstract class TestCase extends Assert implements Test, SelfDescribing
{
final public function __construct(string $name) {}
}

abstract class Assert
Expand Down