r68417 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68416‎ | r68417 | r68418 >
Date:17:40, 22 June 2010
Author:daniel
Status:ok
Tags:
Comment:
meaningful messages when prerequisites are missing
Modified paths:
  • /trunk/extensions/PagedTiffHandler/selenium/PagedTiffHandler_tests.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PagedTiffHandler/selenium/PagedTiffHandler_tests.php
@@ -19,7 +19,7 @@
2020
2121 class SeleniumCheckPrerequisites extends SeleniumTestCase {
2222 public $name = 'Check prerequisites';
23 - private $allChecksOk = true;
 23+ private $prerequisiteError = null;
2424
2525 public function runTest() {
2626 global $wgSeleniumTestsWikiUrl;
@@ -28,22 +28,22 @@
2929
3030 $source = $this->getAttribute( "//div[@id='bodyContent']//ul@id" );
3131 if ( $source != 'filetoc' ) {
32 - $this->allChecksOk = false;
 32+ $this->prerequisiteError = 'Image:Multipage.tiff must exist.';
3333 }
3434
3535 // Check for language
3636 $this->open($wgSeleniumTestsWikiUrl . '/api.php?action=query&meta=userinfo&uiprop=options&format=xml');
3737
38 - $source = $this->getAttribute( "//options/@language" );
39 - if ( $source != 'en' ) {
40 - $this->allChecksOk = false;
 38+ $lang = $this->getAttribute( "//options/@language" );
 39+ if ( $lang != 'en' ) {
 40+ $this->prerequisiteError = 'interface language must be set to English (en), but was '.$lang.'.';
4141 }
4242 }
4343
4444 public function tearDown() {
45 - if ( !$this->allChecksOk ) {
 45+ if ( $this->prerequisiteError ) {
4646 $this->selenium->stop();
47 - die( 'failed' );
 47+ die( 'failed: ' . $this->prerequisiteError . "\n" );
4848 }
4949 }
5050 }

Status & tagging log