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 \Util \Configuration ;
14
+ use PHPUnit \TextUI \Configuration \Registry ;
15
+ use PHPUnit \TextUI \Configuration \TestSuiteCollection ;
16
+ use PHPUnit \TextUI \Configuration \TestSuiteMapper ;
15
17
16
18
/**
17
19
* Integration tests wrapper.
@@ -27,14 +29,15 @@ public static function suite($className)
27
29
{
28
30
$ generator = new WrapperGenerator ();
29
31
$ overrideConfig = Config::getInstance ();
30
- $ configuration = Configuration ::getInstance (self ::getConfigurationFile ());
31
- $ suites = $ configuration ->getTestSuiteConfiguration ();
32
+ $ configuration = Registry ::getInstance ()-> get (self ::getConfigurationFile ());
33
+ $ suitesConfig = $ configuration ->testSuite ();
32
34
$ suite = new TestSuite ();
33
- /** @var TestSuite $testSuite */
34
- foreach ($ suites as $ testSuite ) {
35
- if ($ testSuite -> getName () === 'Magento Integration Tests ' ) {
35
+ /** @var \PHPUnit\TextUI\Configuration\ TestSuite $suiteConfig */
36
+ foreach ($ suitesConfig as $ suiteConfig ) {
37
+ if ($ suiteConfig -> name () === 'Magento Integration Tests ' ) {
36
38
continue ;
37
39
}
40
+ $ testSuite = (new TestSuiteMapper ())->map (TestSuiteCollection::fromArray ([$ suiteConfig ]), '' );
38
41
/** @var TestSuite $test */
39
42
foreach ($ testSuite as $ test ) {
40
43
$ testName = $ test ->getName ();
0 commit comments