File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
tests/PHP/CodeCoverage/Report Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,18 @@ private function reducePaths(&$files)
277277
278278 ksort ($ files );
279279
280- return substr ($ commonPath , 0 , -1 );
280+ if ($ this ->isNotRoot ($ commonPath )) {
281+ $ commonPath = substr ($ commonPath , 0 , -1 );
282+ }
283+ return $ commonPath ;
284+ }
285+
286+ /**
287+ * @param $commonPath
288+ * @return bool
289+ */
290+ private function isNotRoot ($ commonPath )
291+ {
292+ return strlen ($ commonPath ) > 1 ;
281293 }
282294}
Original file line number Diff line number Diff line change @@ -231,6 +231,17 @@ public function reducePathsProvider()
231231 '/home/sb/Money/MoneyBag.php ' => array ()
232232 )
233233 ),
234+ array (
235+ array (
236+ 'driveA/Money.php ' => array (),
237+ 'driveB/MoneyBag.php ' => array ()
238+ ),
239+ '/ ' ,
240+ array (
241+ '/driveA/Money.php ' => array (),
242+ '/driveB/MoneyBag.php ' => array ()
243+ )
244+ ),
234245 array (
235246 array (
236247 'Money.php ' => array ()
You can’t perform that action at this time.
0 commit comments