if ( $this->prevRun ) {
// f = fail, p = pass, n = nonexistent
// codes show before then after
if ( $this->prevRun ) {
// f = fail, p = pass, n = nonexistent
// codes show before then after
'fp' => 'previously failing test(s) now PASSING! :)',
'pn' => 'previously PASSING test(s) removed o_O',
'np' => 'new PASSING test(s) :)',
'fp' => 'previously failing test(s) now PASSING! :)',
'pn' => 'previously PASSING test(s) removed o_O',
'np' => 'new PASSING test(s) :)',
'fn' => 'previously FAILING test(s) removed O_o',
'nf' => 'new FAILING test(s) :(',
'ff' => 'still FAILING test(s) :(',
'fn' => 'previously FAILING test(s) removed O_o',
'nf' => 'new FAILING test(s) :(',
'ff' => 'still FAILING test(s) :(',
- $res = $this->db->select( 'testitem', array( 'ti_name', 'ti_success' ),
- array( 'ti_run' => $this->prevRun ), __METHOD__ );
+ $res = $this->db->select( 'testitem', [ 'ti_name', 'ti_success' ],
+ [ 'ti_run' => $this->prevRun ], __METHOD__ );
- array( 'tr_date', 'tr_mw_version' ),
- array( 'tr_id' => $changedRun ),
+ [ 'tr_date', 'tr_mw_version' ],
+ [ 'tr_id' => $changedRun ],
// Otherwise, this test has previous recorded results.
// See when this test last had a different result to what we're seeing now.
// Otherwise, this test has previous recorded results.
// See when this test last had a different result to what we're seeing now.
// (i.e. it used to work, but now doesn't; or used to fail, but is now fixed.)
// In this situation, give as much info as we can as to when it changed status.
$pre = $this->db->selectRow( 'testrun',
// (i.e. it used to work, but now doesn't; or used to fail, but is now fixed.)
// In this situation, give as much info as we can as to when it changed status.
$pre = $this->db->selectRow( 'testrun',
- array( 'tr_date', 'tr_mw_version' ),
- array( 'tr_id' => $changedRun ),
+ [ 'tr_date', 'tr_mw_version' ],
+ [ 'tr_id' => $changedRun ],
- array( 'tr_date', 'tr_mw_version' ),
- array( "tr_id > " . $this->db->addQuotes( $changedRun ) ),
+ [ 'tr_date', 'tr_mw_version' ],
+ [ "tr_id > " . $this->db->addQuotes( $changedRun ) ],
'tr_date' => $this->db->timestamp(),
'tr_mw_version' => $this->version,
'tr_php_version' => PHP_VERSION,
'tr_db_version' => $this->db->getServerVersion(),
'tr_uname' => php_uname()
'tr_date' => $this->db->timestamp(),
'tr_mw_version' => $this->version,
'tr_php_version' => PHP_VERSION,
'tr_db_version' => $this->db->getServerVersion(),
'tr_uname' => php_uname()
__METHOD__ );
if ( $this->db->getType() === 'postgres' ) {
$this->curRun = $this->db->currentSequenceValue( 'testrun_id_seq' );
__METHOD__ );
if ( $this->db->getType() === 'postgres' ) {
$this->curRun = $this->db->currentSequenceValue( 'testrun_id_seq' );
parent::record( $test, $result );
$this->db->insert( 'testitem',
parent::record( $test, $result );
$this->db->insert( 'testitem',
'ti_run' => $this->curRun,
'ti_name' => $test,
'ti_success' => $result ? 1 : 0,
'ti_run' => $this->curRun,
'ti_name' => $test,
'ti_success' => $result ? 1 : 0,
function setupCurrentTest() {
// "input" and "result" are old section names allowed
// for backwards-compatibility.
function setupCurrentTest() {
// "input" and "result" are old section names allowed
// for backwards-compatibility.
- $input = $this->checkSection( array( 'wikitext', 'input' ), false );
- $result = $this->checkSection( array( 'html/php', 'html/*', 'html', 'result' ), false );
+ $input = $this->checkSection( [ 'wikitext', 'input' ], false );
+ $result = $this->checkSection( [ 'html/php', 'html/*', 'html', 'result' ], false );
'test' => ParserTest::chomp( $this->sectionData['test'] ),
'input' => ParserTest::chomp( $this->sectionData[$input] ),
'result' => ParserTest::chomp( $this->sectionData[$result] ),
'options' => ParserTest::chomp( $this->sectionData['options'] ),
'config' => ParserTest::chomp( $this->sectionData['config'] ),
'test' => ParserTest::chomp( $this->sectionData['test'] ),
'input' => ParserTest::chomp( $this->sectionData[$input] ),
'result' => ParserTest::chomp( $this->sectionData[$result] ),
'options' => ParserTest::chomp( $this->sectionData['options'] ),
'config' => ParserTest::chomp( $this->sectionData['config'] ),
if ( preg_match( '/^!!\s*(\S+)/', $line, $matches ) ) {
$this->section = strtolower( $matches[1] );
if ( preg_match( '/^!!\s*(\S+)/', $line, $matches ) ) {
$this->section = strtolower( $matches[1] );
throw new MWException( __METHOD__ . " can not verify a null section!\n" );
}
if ( !is_array( $tokens ) ) {
throw new MWException( __METHOD__ . " can not verify a null section!\n" );
}
if ( !is_array( $tokens ) ) {
}
if ( count( $tokens ) == 0 ) {
throw new MWException( __METHOD__ . " can not verify zero sections!\n" );
}
if ( count( $tokens ) == 0 ) {
throw new MWException( __METHOD__ . " can not verify zero sections!\n" );