10
10
use Magento \FunctionalTestingFramework \Exceptions \TestFrameworkException ;
11
11
use Magento \FunctionalTestingFramework \Util \Iterator \File ;
12
12
use Magento \FunctionalTestingFramework \Util \Path \FilePathFormatter ;
13
- use Magento \FunctionalTestingFramework \Config \MftfApplicationConfig ;
14
13
15
14
class Root extends Mask
16
15
{
@@ -29,10 +28,21 @@ public function get($filename, $scope)
29
28
{
30
29
// First pick up the root level test suite dir
31
30
$ paths = glob (
32
- FilePathFormatter::format ($ this -> getRootSuiteDirPath () ) . self ::ROOT_SUITE_DIR
31
+ FilePathFormatter::format (TESTS_BP ) . self ::ROOT_SUITE_DIR
33
32
. DIRECTORY_SEPARATOR . '*.xml '
34
33
);
35
34
35
+ // include root suite dir when running standalone version
36
+ $ altPath = MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance ' ;
37
+
38
+ if (realpath ($ altPath ) && ($ altPath !== TESTS_BP )) {
39
+ $ paths = array_merge ($ paths ,
40
+ glob (FilePathFormatter::format ($ altPath ) . self ::ROOT_SUITE_DIR
41
+ . DIRECTORY_SEPARATOR . '*.xml '
42
+ )
43
+ );
44
+ }
45
+
36
46
// Then merge this path into the module based paths
37
47
// Since we are sharing this code with Module based resolution we will unnecessarily glob against modules in the
38
48
// dev/tests dir tree, however as we plan to migrate to app/code this will be a temporary unneeded check.
@@ -42,24 +52,4 @@ public function get($filename, $scope)
42
52
$ iterator = new File ($ paths );
43
53
return $ iterator ;
44
54
}
45
-
46
- /**
47
- * Returns root suite directory _suite 's path
48
- *
49
- * @return string
50
- * @throws TestFrameworkException
51
- */
52
- public function getRootSuiteDirPath ()
53
- {
54
- if (FilePathFormatter::format (MAGENTO_BP , false )
55
- === FilePathFormatter::format (FW_BP , false )) {
56
- return TESTS_BP ;
57
- } else {
58
- if (MftfApplicationConfig::getConfig ()->getPhase ()
59
- !== MftfApplicationConfig::UNIT_TEST_PHASE ) {
60
- return (MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance ' );
61
- }
62
- return TESTS_BP ;
63
- }
64
- }
65
55
}
0 commit comments