|
11 | 11 | use Magento\TestFramework\Workaround\Override\Config;
|
12 | 12 | use Magento\TestFramework\Workaround\Override\WrapperGenerator;
|
13 | 13 | use PHPUnit\Framework\TestSuite;
|
14 |
| -use PHPUnit\TextUI\Configuration\Configuration as LegacyConfiguration; |
15 |
| -use PHPUnit\TextUI\Configuration\Registry; |
16 |
| -use PHPUnit\TextUI\Configuration\TestSuite as LegacyTestSuiteConfiguration; |
17 |
| -use PHPUnit\TextUI\Configuration\TestSuiteCollection as LegacyTestSuiteCollection; |
18 |
| -use PHPUnit\TextUI\Configuration\TestSuiteMapper as LegacyTestSuiteMapper; |
| 14 | +use PHPUnit\TextUI\TestSuiteMapper; |
19 | 15 | use PHPUnit\TextUI\XmlConfiguration\Configuration;
|
20 | 16 | use PHPUnit\TextUI\XmlConfiguration\Loader;
|
21 | 17 | use PHPUnit\TextUI\XmlConfiguration\TestSuite as TestSuiteConfiguration;
|
22 | 18 | use PHPUnit\TextUI\XmlConfiguration\TestSuiteCollection;
|
23 |
| -use PHPUnit\TextUI\XmlConfiguration\TestSuiteMapper; |
24 | 19 |
|
25 | 20 | /**
|
26 | 21 | * Integration tests wrapper.
|
27 | 22 | */
|
28 | 23 | class IntegrationTest extends TestSuite
|
29 | 24 | {
|
30 | 25 | /**
|
31 |
| - * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
32 | 26 | * @param string $className
|
| 27 | + * |
33 | 28 | * @return TestSuite
|
34 | 29 | * @throws \ReflectionException
|
| 30 | + * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
35 | 31 | */
|
36 | 32 | public static function suite($className)
|
37 | 33 | {
|
@@ -79,41 +75,28 @@ private static function getConfigurationFile(): string
|
79 | 75 | $longConfig = $params['configuration'] ?? $defaultConfigFile;
|
80 | 76 | $shortConfig = $params['c'] ?? '';
|
81 | 77 |
|
82 |
| - return $shortConfig ? $shortConfig : $longConfig; |
| 78 | + return $shortConfig ?: $longConfig; |
83 | 79 | }
|
84 | 80 |
|
85 | 81 | /**
|
86 |
| - * Retrieve configuration depends on used phpunit version |
| 82 | + * Retrieve configuration. |
87 | 83 | *
|
88 |
| - * @return Configuration|LegacyConfiguration |
| 84 | + * @return Configuration |
89 | 85 | */
|
90 | 86 | private static function getConfiguration()
|
91 | 87 | {
|
92 |
| - // Compatibility with phpunit < 9.3 |
93 |
| - if (!class_exists(Configuration::class)) { |
94 |
| - // @phpstan-ignore-next-line |
95 |
| - return Registry::getInstance()->get(self::getConfigurationFile()); |
96 |
| - } |
97 |
| - |
98 |
| - // @phpstan-ignore-next-line |
99 | 88 | return (new Loader())->load(self::getConfigurationFile());
|
100 | 89 | }
|
101 | 90 |
|
102 | 91 | /**
|
103 |
| - * Retrieve test suites by suite config depends on used phpunit version |
| 92 | + * Retrieve test suites by suite config. |
| 93 | + * |
| 94 | + * @param TestSuiteConfiguration $suiteConfig |
104 | 95 | *
|
105 |
| - * @param TestSuiteConfiguration|LegacyTestSuiteConfiguration $suiteConfig |
106 | 96 | * @return TestSuite
|
107 | 97 | */
|
108 | 98 | private static function getSuites($suiteConfig)
|
109 | 99 | {
|
110 |
| - // Compatibility with phpunit < 9.3 |
111 |
| - if (!class_exists(Configuration::class)) { |
112 |
| - // @phpstan-ignore-next-line |
113 |
| - return (new LegacyTestSuiteMapper())->map(LegacyTestSuiteCollection::fromArray([$suiteConfig]), ''); |
114 |
| - } |
115 |
| - |
116 |
| - // @phpstan-ignore-next-line |
117 | 100 | return (new TestSuiteMapper())->map(TestSuiteCollection::fromArray([$suiteConfig]), '');
|
118 | 101 | }
|
119 | 102 | }
|
0 commit comments