Merge pull request #1241 from mertasan/ide-reference

feat: Add `references` method for two-way test-source linking
This commit is contained in:
nuno maduro
2025-07-22 22:48:26 +01:00
committed by GitHub

View File

@ -675,6 +675,19 @@ final class TestCall // @phpstan-ignore-line
return $this; return $this;
} }
/**
* Adds one or more references to the tested method or class. This helps
* to link test cases to the source code for easier navigation.
*
* @param array<class-string|string>|class-string ...$classes
*/
public function references(string|array ...$classes): self
{
assert($classes !== []);
return $this;
}
/** /**
* Informs the test runner that no expectations happen in this test, * Informs the test runner that no expectations happen in this test,
* and its purpose is simply to check whether the given code can * and its purpose is simply to check whether the given code can