File tree Expand file tree Collapse file tree 1 file changed +6
-16
lines changed
src/Magento/FunctionalTestingFramework/Test/Util Expand file tree Collapse file tree 1 file changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -137,22 +137,12 @@ private function extractModuleName($path)
137
137
if ($ path === "" ) {
138
138
return "NO MODULE DETECTED " ;
139
139
}
140
- $ positions = [];
141
- $ lastPos = 0 ;
142
- while (($ lastPos = strpos ($ path , DIRECTORY_SEPARATOR , $ lastPos ))!== false ) {
143
- $ positions [] = $ lastPos ;
144
- $ lastPos = $ lastPos + strlen (DIRECTORY_SEPARATOR );
140
+ $ paths = explode (DIRECTORY_SEPARATOR , $ path );
141
+ if ($ paths [count ($ paths )-3 ] == "Mftf " ) {
142
+ // app/code/Magento/[Analytics]/Test/Mftf/Test/SomeText.xml
143
+ return $ paths [count ($ paths )-5 ];
145
144
}
146
- $ slashBeforeModule = $ positions [count ($ positions )-3 ];
147
- $ slashAfterModule = $ positions [count ($ positions )-2 ];
148
- $ output = substr ($ path , $ slashBeforeModule +1 , $ slashAfterModule -$ slashBeforeModule -1 );
149
-
150
- //Check if file was actually from app/code or vendor
151
- if ($ output === "Mftf " ) {
152
- $ slashBeforeModule = $ positions [count ($ positions )-5 ];
153
- $ slashAfterModule = $ positions [count ($ positions )-4 ];
154
- $ output = substr ($ path , $ slashBeforeModule +1 , $ slashAfterModule -$ slashBeforeModule -1 );
155
- }
156
- return $ output ;
145
+ // dev/tests/acceptance/tests/functional/Magento/FunctionalTest/[Analytics]/Test/SomeText.xml
146
+ return $ paths [count ($ paths )-3 ];
157
147
}
158
148
}
You can’t perform that action at this time.
0 commit comments