Index: trunk/phase3/tests/testHelpers.inc |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | if ( $this->total > 0 ) { |
77 | 77 | $this->reportPercentage( $this->success, $this->total ); |
78 | 78 | } else { |
79 | | - wfDie( "No tests found.\n" ); |
| 79 | + throw new MWException( "No tests found.\n" ); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
— | — | @@ -458,7 +458,7 @@ |
459 | 459 | $this->fh = fopen( $this->file, "rt" ); |
460 | 460 | |
461 | 461 | if ( !$this->fh ) { |
462 | | - wfDie( "Couldn't open file '$file'\n" ); |
| 462 | + throw new MWException( "Couldn't open file '$file'\n" ); |
463 | 463 | } |
464 | 464 | |
465 | 465 | $this->parserTest = $parserTest; |
— | — | @@ -469,7 +469,7 @@ |
470 | 470 | |
471 | 471 | function rewind() { |
472 | 472 | if ( fseek( $this->fh, 0 ) ) { |
473 | | - wfDie( "Couldn't fseek to the start of '$this->file'\n" ); |
| 473 | + throw new MWException( "Couldn't fseek to the start of '$this->file'\n" ); |
474 | 474 | } |
475 | 475 | |
476 | 476 | $this->index = -1; |
— | — | @@ -514,11 +514,11 @@ |
515 | 515 | |
516 | 516 | if ( $section == 'endarticle' ) { |
517 | 517 | if ( !isset( $data['text'] ) ) { |
518 | | - wfDie( "'endarticle' without 'text' at line {$this->lineNum} of $this->file\n" ); |
| 518 | + throw new MWException( "'endarticle' without 'text' at line {$this->lineNum} of $this->file\n" ); |
519 | 519 | } |
520 | 520 | |
521 | 521 | if ( !isset( $data['article'] ) ) { |
522 | | - wfDie( "'endarticle' without 'article' at line {$this->lineNum} of $this->file\n" ); |
| 522 | + throw new MWException( "'endarticle' without 'article' at line {$this->lineNum} of $this->file\n" ); |
523 | 523 | } |
524 | 524 | |
525 | 525 | $this->parserTest->addArticle( ParserTest::chomp( $data['article'] ), $data['text'], $this->lineNum ); |
— | — | @@ -531,7 +531,7 @@ |
532 | 532 | |
533 | 533 | if ( $section == 'endhooks' ) { |
534 | 534 | if ( !isset( $data['hooks'] ) ) { |
535 | | - wfDie( "'endhooks' without 'hooks' at line {$this->lineNum} of $this->file\n" ); |
| 535 | + throw new MWException( "'endhooks' without 'hooks' at line {$this->lineNum} of $this->file\n" ); |
536 | 536 | } |
537 | 537 | |
538 | 538 | foreach ( explode( "\n", $data['hooks'] ) as $line ) { |
— | — | @@ -552,7 +552,7 @@ |
553 | 553 | |
554 | 554 | if ( $section == 'endfunctionhooks' ) { |
555 | 555 | if ( !isset( $data['functionhooks'] ) ) { |
556 | | - wfDie( "'endfunctionhooks' without 'functionhooks' at line {$this->lineNum} of $this->file\n" ); |
| 556 | + throw new MWException( "'endfunctionhooks' without 'functionhooks' at line {$this->lineNum} of $this->file\n" ); |
557 | 557 | } |
558 | 558 | |
559 | 559 | foreach ( explode( "\n", $data['functionhooks'] ) as $line ) { |
— | — | @@ -573,15 +573,15 @@ |
574 | 574 | |
575 | 575 | if ( $section == 'end' ) { |
576 | 576 | if ( !isset( $data['test'] ) ) { |
577 | | - wfDie( "'end' without 'test' at line {$this->lineNum} of $this->file\n" ); |
| 577 | + throw new MWException( "'end' without 'test' at line {$this->lineNum} of $this->file\n" ); |
578 | 578 | } |
579 | 579 | |
580 | 580 | if ( !isset( $data['input'] ) ) { |
581 | | - wfDie( "'end' without 'input' at line {$this->lineNum} of $this->file\n" ); |
| 581 | + throw new MWException( "'end' without 'input' at line {$this->lineNum} of $this->file\n" ); |
582 | 582 | } |
583 | 583 | |
584 | 584 | if ( !isset( $data['result'] ) ) { |
585 | | - wfDie( "'end' without 'result' at line {$this->lineNum} of $this->file\n" ); |
| 585 | + throw new MWException( "'end' without 'result' at line {$this->lineNum} of $this->file\n" ); |
586 | 586 | } |
587 | 587 | |
588 | 588 | if ( !isset( $data['options'] ) ) { |
— | — | @@ -611,7 +611,7 @@ |
612 | 612 | } |
613 | 613 | |
614 | 614 | if ( isset ( $data[$section] ) ) { |
615 | | - wfDie( "duplicate section '$section' at line {$this->lineNum} of $this->file\n" ); |
| 615 | + throw new MWException( "duplicate section '$section' at line {$this->lineNum} of $this->file\n" ); |
616 | 616 | } |
617 | 617 | |
618 | 618 | $data[$section] = ''; |
Index: trunk/phase3/tests/parser/parserTest.inc |
— | — | @@ -1138,14 +1138,13 @@ |
1139 | 1139 | $title = Title::newFromText( $name ); |
1140 | 1140 | |
1141 | 1141 | if ( is_null( $title ) ) { |
1142 | | - wfDie( "invalid title ('$name' => '$title') at line $line\n" ); |
| 1142 | + throw new MWException( "invalid title ('$name' => '$title') at line $line\n" ); |
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | $aid = $title->getArticleID( Title::GAID_FOR_UPDATE ); |
1146 | 1146 | |
1147 | 1147 | if ( $aid != 0 ) { |
1148 | | - debug_print_backtrace(); |
1149 | | - wfDie( "duplicate article '$name' at line $line\n" ); |
| 1148 | + throw new MWException( "duplicate article '$name' at line $line\n" ); |
1150 | 1149 | } |
1151 | 1150 | |
1152 | 1151 | $art = new Article( $title ); |