@@ -76,16 +76,6 @@ final class TestSuiteSorter
76
76
private array $ defectSortOrder = [];
77
77
private readonly ResultCache $ cache ;
78
78
79
- /**
80
- * @psalm-var array<string> A list of normalized names of tests before reordering
81
- */
82
- private array $ originalExecutionOrder = [];
83
-
84
- /**
85
- * @psalm-var array<string> A list of normalized names of tests affected by reordering
86
- */
87
- private array $ executionOrder = [];
88
-
89
79
public function __construct (?ResultCache $ cache = null )
90
80
{
91
81
$ this ->cache = $ cache ?? new NullResultCache ;
@@ -94,7 +84,7 @@ public function __construct(?ResultCache $cache = null)
94
84
/**
95
85
* @throws Exception
96
86
*/
97
- public function reorderTestsInSuite (Test $ suite , int $ order , bool $ resolveDependencies , int $ orderDefects, bool $ isRootTestSuite = true ): void
87
+ public function reorderTestsInSuite (Test $ suite , int $ order , bool $ resolveDependencies , int $ orderDefects ): void
98
88
{
99
89
$ allowedOrders = [
100
90
self ::ORDER_DEFAULT ,
@@ -117,13 +107,9 @@ public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDepend
117
107
throw new InvalidOrderException ;
118
108
}
119
109
120
- if ($ isRootTestSuite ) {
121
- $ this ->originalExecutionOrder = $ this ->calculateTestExecutionOrder ($ suite );
122
- }
123
-
124
110
if ($ suite instanceof TestSuite) {
125
111
foreach ($ suite as $ _suite ) {
126
- $ this ->reorderTestsInSuite ($ _suite , $ order , $ resolveDependencies , $ orderDefects, false );
112
+ $ this ->reorderTestsInSuite ($ _suite , $ order , $ resolveDependencies , $ orderDefects );
127
113
}
128
114
129
115
if ($ orderDefects === self ::ORDER_DEFECTS_FIRST ) {
@@ -132,20 +118,6 @@ public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDepend
132
118
133
119
$ this ->sort ($ suite , $ order , $ resolveDependencies , $ orderDefects );
134
120
}
135
-
136
- if ($ isRootTestSuite ) {
137
- $ this ->executionOrder = $ this ->calculateTestExecutionOrder ($ suite );
138
- }
139
- }
140
-
141
- public function getOriginalExecutionOrder (): array
142
- {
143
- return $ this ->originalExecutionOrder ;
144
- }
145
-
146
- public function getExecutionOrder (): array
147
- {
148
- return $ this ->executionOrder ;
149
121
}
150
122
151
123
private function sort (TestSuite $ suite , int $ order , bool $ resolveDependencies , int $ orderDefects ): void
@@ -324,21 +296,4 @@ private function resolveDependencies(array $tests): array
324
296
325
297
return array_merge ($ newTestOrder , $ tests );
326
298
}
327
-
328
- private function calculateTestExecutionOrder (Test $ suite ): array
329
- {
330
- $ tests = [];
331
-
332
- if ($ suite instanceof TestSuite) {
333
- foreach ($ suite ->tests () as $ test ) {
334
- if (!$ test instanceof TestSuite && $ test instanceof Reorderable) {
335
- $ tests [] = $ test ->sortId ();
336
- } else {
337
- $ tests = array_merge ($ tests , $ this ->calculateTestExecutionOrder ($ test ));
338
- }
339
- }
340
- }
341
-
342
- return $ tests ;
343
- }
344
299
}
0 commit comments