File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 2626 */
2727final readonly class TestMethodBuilder
2828{
29- public static function fromTestCase (TestCase $ testCase ): TestMethod
29+ public static function fromTestCase (TestCase $ testCase, bool $ useTestCaseForTestDox = true ): TestMethod
3030 {
3131 $ methodName = $ testCase ->name ();
3232 $ location = Reflection::sourceLocationFor ($ testCase ::class, $ methodName );
3333
34+ if ($ useTestCaseForTestDox ) {
35+ $ testDox = TestDoxBuilder::fromTestCase ($ testCase );
36+ } else {
37+ $ testDox = TestDoxBuilder::fromClassNameAndMethodName ($ testCase ::class, $ testCase ->name ());
38+ }
39+
3440 return new TestMethod (
3541 $ testCase ::class,
3642 $ methodName ,
3743 $ location ['file ' ],
3844 $ location ['line ' ],
39- TestDoxBuilder:: fromTestCase ( $ testCase ) ,
45+ $ testDox ,
4046 MetadataRegistry::parser ()->forClassAndMethod ($ testCase ::class, $ methodName ),
4147 self ::dataFor ($ testCase ),
4248 );
You can’t perform that action at this time.
0 commit comments