@@ -64,7 +64,7 @@ protected function loadConfiguredGroupSettings()
64
64
if (is_array ($ tests )) {
65
65
foreach ($ tests as $ test ) {
66
66
$ file = str_replace (['/ ' , '\\' ], [DIRECTORY_SEPARATOR , DIRECTORY_SEPARATOR ], $ test );
67
- $ this ->testsInGroups [$ group ][] = $ this ->normalizeFilePath ($ file );
67
+ $ this ->testsInGroups [$ group ][] = $ this ->normalizeFilePath ($ file, $ group );
68
68
}
69
69
} elseif (is_file (Configuration::projectDir () . $ tests )) {
70
70
$ handle = @fopen (Configuration::projectDir () . $ tests , "r " );
@@ -78,7 +78,7 @@ protected function loadConfiguredGroupSettings()
78
78
}
79
79
80
80
$ file = str_replace (['/ ' , '\\' ], [DIRECTORY_SEPARATOR , DIRECTORY_SEPARATOR ], trim ($ test ));
81
- $ this ->testsInGroups [$ group ][] = $ this ->normalizeFilePath ($ file );
81
+ $ this ->testsInGroups [$ group ][] = $ this ->normalizeFilePath ($ file, $ group );
82
82
}
83
83
fclose ($ handle );
84
84
}
@@ -88,45 +88,47 @@ protected function loadConfiguredGroupSettings()
88
88
89
89
/**
90
90
* @param string $file
91
+ * @param string $group
91
92
* @return false|string
92
93
* @throws ConfigurationException
93
94
*/
94
- private function normalizeFilePath ($ file )
95
+ private function normalizeFilePath ($ file, $ group )
95
96
{
96
97
$ pathParts = explode (': ' , $ file );
97
98
if (codecept_is_path_absolute ($ file )) {
98
99
if ($ file [0 ] === '/ ' && count ($ pathParts ) > 1 ) {
99
100
//take segment before first :
100
- $ this ->checkIfFileExists ($ pathParts [0 ]);
101
+ $ this ->checkIfFileExists ($ pathParts [0 ], $ group );
101
102
return sprintf ('%s:%s ' , realpath ($ pathParts [0 ]), $ pathParts [1 ]);
102
103
} else if (count ($ pathParts ) > 2 ) {
103
104
//on Windows take segment before second :
104
105
$ fullPath = $ pathParts [0 ] . ': ' . $ pathParts [1 ];
105
- $ this ->checkIfFileExists ($ fullPath );
106
+ $ this ->checkIfFileExists ($ fullPath, $ group );
106
107
return sprintf ('%s:%s ' , realpath ($ fullPath ), $ pathParts [2 ]);
107
108
}
108
109
109
110
$ this ->checkIfFileExists ($ file );
110
111
return realpath ($ file );
111
112
} elseif (strpos ($ file , ': ' ) === false ) {
112
113
$ dirtyPath = Configuration::projectDir () . $ file ;
113
- $ this ->checkIfFileExists ($ dirtyPath );
114
+ $ this ->checkIfFileExists ($ dirtyPath, $ group );
114
115
return realpath ($ dirtyPath );
115
116
}
116
117
117
118
$ dirtyPath = Configuration::projectDir () . $ pathParts [0 ];
118
- $ this ->checkIfFileExists ($ dirtyPath );
119
+ $ this ->checkIfFileExists ($ dirtyPath, $ group );
119
120
return sprintf ('%s:%s ' , realpath ($ dirtyPath ), $ pathParts [1 ]);
120
121
}
121
122
122
123
/**
123
124
* @param string $path
125
+ * @param string $group
124
126
* @throws ConfigurationException
125
127
*/
126
- private function checkIfFileExists ($ path )
128
+ private function checkIfFileExists ($ path, $ group )
127
129
{
128
130
if (!file_exists ($ path )) {
129
- throw new ConfigurationException ('GroupManager: File or directory ' . $ path . ' does not exist ' );
131
+ throw new ConfigurationException ('GroupManager: File or directory ' . $ path . ' set in ' . $ group . ' group does not exist ' );
130
132
}
131
133
}
132
134
0 commit comments