File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,62 @@ public function testGetPackageInformation3()
358358 );
359359 }
360360
361+ /**
362+ * @covers PHP_CodeCoverage_Util::reducePaths
363+ */
364+ public function testReducePaths ()
365+ {
366+ $ files = array (
367+ '/home/sb/Money/Money.php ' => array (),
368+ '/home/sb/Money/MoneyBag.php ' => array ()
369+ );
370+
371+ $ commonPath = PHP_CodeCoverage_Util::reducePaths ($ files );
372+
373+ $ this ->assertEquals (
374+ array (
375+ 'Money.php ' => array (),
376+ 'MoneyBag.php ' => array ()
377+ ),
378+ $ files
379+ );
380+
381+ $ this ->assertEquals ('/home/sb/Money/ ' , $ commonPath );
382+ }
383+
384+ /**
385+ * @covers PHP_CodeCoverage_Util::reducePaths
386+ */
387+ public function testReducePaths2 ()
388+ {
389+ $ files = array ();
390+
391+ $ commonPath = PHP_CodeCoverage_Util::reducePaths ($ files );
392+
393+ $ this ->assertEquals ('. ' , $ commonPath );
394+ }
395+
396+ /**
397+ * @covers PHP_CodeCoverage_Util::reducePaths
398+ */
399+ public function testReducePaths3 ()
400+ {
401+ $ files = array (
402+ '/home/sb/Money/Money.php ' => array ()
403+ );
404+
405+ $ commonPath = PHP_CodeCoverage_Util::reducePaths ($ files );
406+
407+ $ this ->assertEquals (
408+ array (
409+ 'Money.php ' => array ()
410+ ),
411+ $ files
412+ );
413+
414+ $ this ->assertEquals ('/home/sb/Money/ ' , $ commonPath );
415+ }
416+
361417 public function getLinesToBeCoveredProvider ()
362418 {
363419 return array (
You can’t perform that action at this time.
0 commit comments