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 26
26
*/
27
27
final readonly class TestMethodBuilder
28
28
{
29
- public static function fromTestCase (TestCase $ testCase ): TestMethod
29
+ public static function fromTestCase (TestCase $ testCase, bool $ useTestCaseForTestDox = true ): TestMethod
30
30
{
31
31
$ methodName = $ testCase ->name ();
32
32
$ location = Reflection::sourceLocationFor ($ testCase ::class, $ methodName );
33
33
34
+ if ($ useTestCaseForTestDox ) {
35
+ $ testDox = TestDoxBuilder::fromTestCase ($ testCase );
36
+ } else {
37
+ $ testDox = TestDoxBuilder::fromClassNameAndMethodName ($ testCase ::class, $ testCase ->name ());
38
+ }
39
+
34
40
return new TestMethod (
35
41
$ testCase ::class,
36
42
$ methodName ,
37
43
$ location ['file ' ],
38
44
$ location ['line ' ],
39
- TestDoxBuilder:: fromTestCase ( $ testCase ) ,
45
+ $ testDox ,
40
46
MetadataRegistry::parser ()->forClassAndMethod ($ testCase ::class, $ methodName ),
41
47
self ::dataFor ($ testCase ),
42
48
);
You can’t perform that action at this time.
0 commit comments