<?php
+/**
+ * Recording for passing/failing tests.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Testing
+ */
class TestRecorder {
var $parent;
* and all that fun stuff
*/
function start() {
- $this->db->begin();
+ $this->db->begin( __METHOD__ );
if ( ! $this->db->tableExists( 'testrun' )
|| ! $this->db->tableExists( 'testitem' ) )
private $eof;
function __construct( $file, $parserTest ) {
- global $IP;
-
$this->file = $file;
$this->fh = fopen( $this->file, "rt" );
}
$this->parserTest = $parserTest;
- $this->parserTest->showRunFile( wfRelativePath( $this->file, $IP ) );
$this->lineNum = $this->index = 0;
}
}
if ( isset ( $this->sectionData[$this->section] ) ) {
- throw new MWException( "duplicate section '$section' at line {$this->lineNum} of $this->file\n" );
+ throw new MWException( "duplicate section '$this->section' at line {$this->lineNum} of $this->file\n" );
}
$this->sectionData[$this->section] = '';
private function clearSection() {
$this->sectionData = array();
$this->section = null;
-
+
}
/**
* Throw an exception if it is not set, referencing current section
* and adding the current file name and line number
*
- * @param $token String: expected token that should have been mentionned before closing this section
+ * @param $token String: expected token that should have been mentionned before closing this section
*/
private function checkSection( $token ) {
if( is_null( $this->section ) ) {
}
}
-
/**
* A class to delay execution of a parser test hooks.
- *
*/
class DelayedParserTest {
/**
* Called whenever we actually want to run the hook.
- * Should be the case if we found the parserTest is not disabled
+ * Should be the case if we found the parserTest is not disabled
*/
public function unleash( &$parserTest ) {
if( !($parserTest instanceof ParserTest || $parserTest instanceof NewParserTest