r45949 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45948‎ | r45949 | r45950 >
Date:05:48, 21 January 2009
Author:werdna
Status:deferred
Tags:
Comment:
Fix a bug, and commit the PHP testing framework.
Modified paths:
  • /branches/change-tagging/extensions/AbuseFilter/AbuseFilter.parser.php (modified) (history)
  • /branches/change-tagging/extensions/AbuseFilter/phpTest.php (modified) (history)

Diff [purge]

Index: branches/change-tagging/extensions/AbuseFilter/AbuseFilter.parser.php
@@ -558,21 +558,15 @@
559559 throw new AFPEexception( "Expected ( at char {$this->mCur->value}" );
560560 wfProfileIn( __METHOD__."-loadargs" );
561561 $args = array();
562 - if( $this->mCur->type != AFPToken::TBrace || $this->mCur->value != ')' )
563 - do {
564 - $this->move();
565 - $r = new AFPData();
566 - try {
567 - $this->doLevelAtom( $r );
568 - } catch (AFPException $e) {
569 - $this->move( -1 );
570 - $this->doLevelSet( $r );
571 - }
572 - $args[] = $r;
573 - } while( $this->mCur->type == AFPToken::TComma );
 562+ do {
 563+ $this->move();
 564+ $r = new AFPData();
 565+ $this->doLevelSet( $r );
 566+ $args[] = $r;
 567+ } while( $this->mCur->type == AFPToken::TComma );
574568
575569 if( $this->mCur->type != AFPToken::TBrace || $this->mCur->value != ')' ) {
576 - throw new AFPException( "Expected ) at char {$this->mCur->pos}" );
 570+ throw new AFPException( "Expected ) at char {$this->mCur->pos}, instead I see {$this->mCur->value}, a {$this->mCur->type}" );
577571 }
578572 wfProfileOut( __METHOD__."-loadargs" );
579573
Index: branches/change-tagging/extensions/AbuseFilter/phpTest.php
@@ -4,10 +4,7 @@
55 * Runs tests against the PHP parser.
66 */
77
8 -require_once ( getenv('MW_INSTALL_PATH') !== false
9 - ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc"
10 - : dirname( __FILE__ ) . '/../../maintenance/commandLine.inc' );
11 -
 8+require_once( '/home/andrew/wm-svn/phase3/maintenance/commandLine.inc' );
129 $tester = new AbuseFilterParser;
1310
1411 $test_path = dirname( __FILE__ )."/parser_native/tests";
@@ -47,4 +44,4 @@
4845 }
4946 }
5047
51 -print "$pass tests passed out of $check\n";
\ No newline at end of file
 48+print "$pass tests passed out of $check\n";

Status & tagging log