https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112331

Revision: 112331
Author:   hashar
Date:     2012-02-24 16:54:48 +0000 (Fri, 24 Feb 2012)
Log Message:
-----------
better structure filename error output

When dumping an array, PHPUnit limit the number of characters shown. That would
just hide the relevant part of the path:

1) StructureTest::testUnitTestFileNamesEndWithTest
[...]
 Array (
+    0 => '/some/path/tests/phpunit/incl...ge.php'
+    1 => '/some/path/tests/phpunit/incl...ki.php'
 )

By stripping the common path ( /some/path/tests/phpunit ), we end up with a
more useful output:

 Array (
+    0 => 'includes/RecentChange.php'
+    1 => 'includes/Wiki.php'
 )

Modified Paths:
--------------
    trunk/phase3/tests/phpunit/StructureTest.php

Modified: trunk/phase3/tests/phpunit/StructureTest.php
===================================================================
--- trunk/phase3/tests/phpunit/StructureTest.php        2012-02-24 16:42:21 UTC 
(rev 112330)
+++ trunk/phase3/tests/phpunit/StructureTest.php        2012-02-24 16:54:48 UTC 
(rev 112331)
@@ -39,11 +39,14 @@
                        $results,
                        array( $this, 'filterSuites' )
                );
-
+               $strip = strlen( $rootPath ) - 1;
+               foreach( $results as $k => $v) {
+                       $results[$k] = substr( $v, $strip );
+               }
                $this->assertEquals(
                        array(),
                        $results,
-                       'Unit test file names must end with Test.'
+                       "Unit test file in $rootPath must end with Test."
                );
        }
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to