Integer comparison in Hebrew plural forms.
[lhc/web/wiklou.git] / tests / testHelpers.inc
index 1cd611f..7fc60a5 100644 (file)
@@ -313,8 +313,6 @@ class TestFileIterator implements Iterator {
        private $eof;
 
        function __construct( $file, $parserTest ) {
-               global $IP;
-
                $this->file = $file;
                $this->fh = fopen( $this->file, "rt" );
 
@@ -323,7 +321,6 @@ class TestFileIterator implements Iterator {
                }
 
                $this->parserTest = $parserTest;
-               $this->parserTest->showRunFile( wfRelativePath( $this->file, $IP ) );
 
                $this->lineNum = $this->index = 0;
        }
@@ -515,10 +512,8 @@ class TestFileIterator implements Iterator {
        }
 }
 
-
 /**
  * A class to delay execution of a parser test hooks.
- *   
  */
 class DelayedParserTest {
 
@@ -543,7 +538,12 @@ class DelayedParserTest {
         * Called whenever we actually want to run the hook.
         * Should be the case if we found the parserTest is not disabled 
         */
-       public function unleash( ParserTest &$parserTest ) {
+       public function unleash( &$parserTest ) {
+               if( !($parserTest instanceof ParserTest || $parserTest instanceof NewParserTest
+               ) ) {
+                       throw new MWException( __METHOD__ . " must be passed an instance of ParserTest or NewParserTest classes\n" );
+               }
+
                # Trigger delayed hooks. Any failure will make us abort
                foreach( $this->hooks as $hook ) {
                        $ret = $parserTest->requireHook( $hook );
@@ -579,4 +579,4 @@ class DelayedParserTest {
                $this->fnHooks[] = $fnHook;
        }
 
-}
+}
\ No newline at end of file