registration: Add hint about UnitTestsList hook in conversion script
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 7 Aug 2016 09:27:09 +0000 (02:27 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Sun, 7 Aug 2016 09:27:09 +0000 (02:27 -0700)
Change-Id: Ia161c2e10943e75c98ee8e0d2341bc2c9a418faf

maintenance/convertExtensionToRegistration.php

index 6d2a0e9..e83d7c6 100644 (file)
@@ -230,6 +230,13 @@ class ConvertExtensionToRegistration extends Maintenance {
 
        public function handleHooks( $realName, $value ) {
                foreach ( $value as $hookName => &$handlers ) {
+                       if ( $hookName === 'UnitTestsList' ) {
+                               $this->output( "Note: the UnitTestsList hook is no longer necessary as " .
+                                       "long as your tests are located in the \"tests/phpunit/\" directory. " .
+                                       "Please see <https://www.mediawiki.org/wiki/Manual:PHP_unit_testing/" .
+                                       "Writing_unit_tests_for_extensions#Register_your_tests> for more details.\n"
+                               );
+                       }
                        foreach ( $handlers as $func ) {
                                if ( $func instanceof Closure ) {
                                        $this->error( "Error: Closures cannot be converted to JSON. " .