Skip to content

Commit 72501f9

Browse files
committed
[TASK] Reorganize Integration tests in subdirectories
We have so many integration tests now that we need to organize them better.
1 parent 06b57f0 commit 72501f9

File tree

345 files changed

+6
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+6
-4
lines changed

tests/Integration/IntegrationTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Symfony\Component\Finder\Finder as SymfonyFinder;
1414

1515
use function array_filter;
16+
use function array_merge;
1617
use function array_walk;
1718
use function assert;
1819
use function escapeshellarg;
@@ -151,28 +152,29 @@ public static function getTrimmedFileContent(string $file): string
151152
/** @return mixed[] */
152153
public static function getTestsForDirectoryTest(): array
153154
{
154-
return self::getTestsForDirectory();
155+
return self::getTestsForDirectory(__DIR__ . '/tests');
155156
}
156157

157158
/** @return mixed[] */
158159
public static function getTestsForLatex(): array
159160
{
160-
return self::getTestsForDirectory('/tests-latex');
161+
return self::getTestsForDirectory(__DIR__ . '/tests-latex');
161162
}
162163

163164
/** @return mixed[] */
164-
private static function getTestsForDirectory(string $directory = '/tests'): array
165+
private static function getTestsForDirectory(string $directory): array
165166
{
166167
$finder = new SymfonyFinder();
167168
$finder
168169
->directories()
169-
->in(__DIR__ . $directory)
170+
->in($directory)
170171
->depth('== 0');
171172

172173
$tests = [];
173174

174175
foreach ($finder as $dir) {
175176
if (!file_exists($dir->getPathname() . '/input')) {
177+
$tests = array_merge($tests, self::getTestsForDirectory($dir->getPathname()));
176178
continue;
177179
}
178180

0 commit comments

Comments
 (0)