MediaWiki  1.23.2
testHelpers.inc
Go to the documentation of this file.
1 <?php
37 interface ITestRecorder {
38 
40  public function start();
41 
43  public function record( $test, $result );
44 
46  public function report();
47 
49  public function end();
50 
51 }
52 
53 class TestRecorder implements ITestRecorder {
54  var $parent;
55  var $term;
56 
57  function __construct( $parent ) {
58  $this->parent = $parent;
59  $this->term = $parent->term;
60  }
61 
62  function start() {
63  $this->total = 0;
64  $this->success = 0;
65  }
66 
67  function record( $test, $result ) {
68  $this->total++;
69  $this->success += ( $result ? 1 : 0 );
70  }
71 
72  function end() {
73  // dummy
74  }
75 
76  function report() {
77  if ( $this->total > 0 ) {
78  $this->reportPercentage( $this->success, $this->total );
79  } else {
80  throw new MWException( "No tests found.\n" );
81  }
82  }
83 
85  $ratio = wfPercent( 100 * $success / $total );
86  print $this->term->color( 1 ) . "Passed $success of $total tests ($ratio)... ";
87 
88  if ( $success == $total ) {
89  print $this->term->color( 32 ) . "ALL TESTS PASSED!";
90  } else {
92  print $this->term->color( 31 ) . "$failed tests failed!";
93  }
94 
95  print $this->term->reset() . "\n";
96 
97  return ( $success == $total );
98  }
99 }
100 
102  protected $lb; // /< Database load balancer
103  protected $db; // /< Database connection to the main DB
104  protected $curRun; // /< run ID number for the current run
105  protected $prevRun; // /< run ID number for the previous run, if any
106  protected $results; // /< Result array
107 
111  function __construct( $parent ) {
112  parent::__construct( $parent );
113 
114  $this->lb = wfGetLBFactory()->newMainLB();
115  // This connection will have the wiki's table prefix, not parsertest_
116  $this->db = $this->lb->getConnection( DB_MASTER );
117  }
118 
123  function start() {
124  parent::start();
125 
126  if ( !$this->db->tableExists( 'testrun', __METHOD__ )
127  || !$this->db->tableExists( 'testitem', __METHOD__ )
128  ) {
129  print "WARNING> `testrun` table not found in database.\n";
130  $this->prevRun = false;
131  } else {
132  // We'll make comparisons against the previous run later...
133  $this->prevRun = $this->db->selectField( 'testrun', 'MAX(tr_id)' );
134  }
135 
136  $this->results = array();
137  }
138 
139  function record( $test, $result ) {
140  parent::record( $test, $result );
141  $this->results[$test] = $result;
142  }
143 
144  function report() {
145  if ( $this->prevRun ) {
146  // f = fail, p = pass, n = nonexistent
147  // codes show before then after
148  $table = array(
149  'fp' => 'previously failing test(s) now PASSING! :)',
150  'pn' => 'previously PASSING test(s) removed o_O',
151  'np' => 'new PASSING test(s) :)',
152 
153  'pf' => 'previously passing test(s) now FAILING! :(',
154  'fn' => 'previously FAILING test(s) removed O_o',
155  'nf' => 'new FAILING test(s) :(',
156  'ff' => 'still FAILING test(s) :(',
157  );
158 
159  $prevResults = array();
160 
161  $res = $this->db->select( 'testitem', array( 'ti_name', 'ti_success' ),
162  array( 'ti_run' => $this->prevRun ), __METHOD__ );
163 
164  foreach ( $res as $row ) {
165  if ( !$this->parent->regex
166  || preg_match( "/{$this->parent->regex}/i", $row->ti_name )
167  ) {
168  $prevResults[$row->ti_name] = $row->ti_success;
169  }
170  }
171 
172  $combined = array_keys( $this->results + $prevResults );
173 
174  # Determine breakdown by change type
175  $breakdown = array();
176  foreach ( $combined as $test ) {
177  if ( !isset( $prevResults[$test] ) ) {
178  $before = 'n';
179  } elseif ( $prevResults[$test] == 1 ) {
180  $before = 'p';
181  } else /* if ( $prevResults[$test] == 0 )*/ {
182  $before = 'f';
183  }
184 
185  if ( !isset( $this->results[$test] ) ) {
186  $after = 'n';
187  } elseif ( $this->results[$test] == 1 ) {
188  $after = 'p';
189  } else /*if ( $this->results[$test] == 0 ) */ {
190  $after = 'f';
191  }
192 
193  $code = $before . $after;
194 
195  if ( isset( $table[$code] ) ) {
196  $breakdown[$code][$test] = $this->getTestStatusInfo( $test, $after );
197  }
198  }
199 
200  # Write out results
201  foreach ( $table as $code => $label ) {
202  if ( !empty( $breakdown[$code] ) ) {
203  $count = count( $breakdown[$code] );
204  printf( "\n%4d %s\n", $count, $label );
205 
206  foreach ( $breakdown[$code] as $differing_test_name => $statusInfo ) {
207  print " * $differing_test_name [$statusInfo]\n";
208  }
209  }
210  }
211  } else {
212  print "No previous test runs to compare against.\n";
213  }
214 
215  print "\n";
216  parent::report();
217  }
218 
224  private function getTestStatusInfo( $testname, $after ) {
225  // If we're looking at a test that has just been removed, then say when it first appeared.
226  if ( $after == 'n' ) {
227  $changedRun = $this->db->selectField( 'testitem',
228  'MIN(ti_run)',
229  array( 'ti_name' => $testname ),
230  __METHOD__ );
231  $appear = $this->db->selectRow( 'testrun',
232  array( 'tr_date', 'tr_mw_version' ),
233  array( 'tr_id' => $changedRun ),
234  __METHOD__ );
235 
236  return "First recorded appearance: "
237  . date( "d-M-Y H:i:s", strtotime( $appear->tr_date ) )
238  . ", " . $appear->tr_mw_version;
239  }
240 
241  // Otherwise, this test has previous recorded results.
242  // See when this test last had a different result to what we're seeing now.
243  $conds = array(
244  'ti_name' => $testname,
245  'ti_success' => ( $after == 'f' ? "1" : "0" ) );
246 
247  if ( $this->curRun ) {
248  $conds[] = "ti_run != " . $this->db->addQuotes( $this->curRun );
249  }
250 
251  $changedRun = $this->db->selectField( 'testitem', 'MAX(ti_run)', $conds, __METHOD__ );
252 
253  // If no record of ever having had a different result.
254  if ( is_null( $changedRun ) ) {
255  if ( $after == "f" ) {
256  return "Has never passed";
257  } else {
258  return "Has never failed";
259  }
260  }
261 
262  // Otherwise, we're looking at a test whose status has changed.
263  // (i.e. it used to work, but now doesn't; or used to fail, but is now fixed.)
264  // In this situation, give as much info as we can as to when it changed status.
265  $pre = $this->db->selectRow( 'testrun',
266  array( 'tr_date', 'tr_mw_version' ),
267  array( 'tr_id' => $changedRun ),
268  __METHOD__ );
269  $post = $this->db->selectRow( 'testrun',
270  array( 'tr_date', 'tr_mw_version' ),
271  array( "tr_id > " . $this->db->addQuotes( $changedRun ) ),
272  __METHOD__,
273  array( "LIMIT" => 1, "ORDER BY" => 'tr_id' )
274  );
275 
276  if ( $post ) {
277  $postDate = date( "d-M-Y H:i:s", strtotime( $post->tr_date ) ) . ", {$post->tr_mw_version}";
278  } else {
279  $postDate = 'now';
280  }
281 
282  return ( $after == "f" ? "Introduced" : "Fixed" ) . " between "
283  . date( "d-M-Y H:i:s", strtotime( $pre->tr_date ) ) . ", " . $pre->tr_mw_version
284  . " and $postDate";
285  }
286 
290  function end() {
291  $this->lb->commitMasterChanges();
292  $this->lb->closeAll();
293  parent::end();
294  }
295 }
296 
298  var $version;
299 
304  function start() {
305  $this->db->begin( __METHOD__ );
306 
307  if ( !$this->db->tableExists( 'testrun' )
308  || !$this->db->tableExists( 'testitem' )
309  ) {
310  print "WARNING> `testrun` table not found in database. Trying to create table.\n";
311  $this->db->sourceFile( $this->db->patchPath( 'patch-testrun.sql' ) );
312  echo "OK, resuming.\n";
313  }
314 
315  parent::start();
316 
317  $this->db->insert( 'testrun',
318  array(
319  'tr_date' => $this->db->timestamp(),
320  'tr_mw_version' => $this->version,
321  'tr_php_version' => phpversion(),
322  'tr_db_version' => $this->db->getServerVersion(),
323  'tr_uname' => php_uname()
324  ),
325  __METHOD__ );
326  if ( $this->db->getType() === 'postgres' ) {
327  $this->curRun = $this->db->currentSequenceValue( 'testrun_id_seq' );
328  } else {
329  $this->curRun = $this->db->insertId();
330  }
331  }
332 
339  function record( $test, $result ) {
340  parent::record( $test, $result );
341 
342  $this->db->insert( 'testitem',
343  array(
344  'ti_run' => $this->curRun,
345  'ti_name' => $test,
346  'ti_success' => $result ? 1 : 0,
347  ),
348  __METHOD__ );
349  }
350 }
351 
352 class TestFileIterator implements Iterator {
353  private $file;
354  private $fh;
355  private $parserTest; /* An instance of ParserTest (parserTests.php) or MediaWikiParserTest (phpunit) */
356  private $index = 0;
357  private $test;
358  private $section = null;
360  private $sectionData = array();
361  private $lineNum;
362  private $eof;
363 
365  $this->file = $file;
366  $this->fh = fopen( $this->file, "rt" );
367 
368  if ( !$this->fh ) {
369  throw new MWException( "Couldn't open file '$file'\n" );
370  }
371 
372  $this->parserTest = $parserTest;
373 
374  $this->lineNum = $this->index = 0;
375  }
376 
377  function rewind() {
378  if ( fseek( $this->fh, 0 ) ) {
379  throw new MWException( "Couldn't fseek to the start of '$this->file'\n" );
380  }
381 
382  $this->index = -1;
383  $this->lineNum = 0;
384  $this->eof = false;
385  $this->next();
386 
387  return true;
388  }
389 
390  function current() {
391  return $this->test;
392  }
393 
394  function key() {
395  return $this->index;
396  }
397 
398  function next() {
399  if ( $this->readNextTest() ) {
400  $this->index++;
401  return true;
402  } else {
403  $this->eof = true;
404  }
405  }
406 
407  function valid() {
408  return $this->eof != true;
409  }
410 
411  function readNextTest() {
412  $this->clearSection();
413 
414  # Create a fake parser tests which never run anything unless
415  # asked to do so. This will avoid running hooks for a disabled test
416  $delayedParserTest = new DelayedParserTest();
417 
418  while ( false !== ( $line = fgets( $this->fh ) ) ) {
419  $this->lineNum++;
420  $matches = array();
421 
422  if ( preg_match( '/^!!\s*(\S+)/', $line, $matches ) ) {
423  $this->section = strtolower( $matches[1] );
424 
425  if ( $this->section == 'endarticle' ) {
426  $this->checkSection( 'text' );
427  $this->checkSection( 'article' );
428 
429  $this->parserTest->addArticle( ParserTest::chomp( $this->sectionData['article'] ), $this->sectionData['text'], $this->lineNum );
430 
431  $this->clearSection();
432 
433  continue;
434  }
435 
436  if ( $this->section == 'endhooks' ) {
437  $this->checkSection( 'hooks' );
438 
439  foreach ( explode( "\n", $this->sectionData['hooks'] ) as $line ) {
440  $line = trim( $line );
441 
442  if ( $line ) {
443  $delayedParserTest->requireHook( $line );
444  }
445  }
446 
447  $this->clearSection();
448 
449  continue;
450  }
451 
452  if ( $this->section == 'endfunctionhooks' ) {
453  $this->checkSection( 'functionhooks' );
454 
455  foreach ( explode( "\n", $this->sectionData['functionhooks'] ) as $line ) {
456  $line = trim( $line );
457 
458  if ( $line ) {
459  $delayedParserTest->requireFunctionHook( $line );
460  }
461  }
462 
463  $this->clearSection();
464 
465  continue;
466  }
467 
468  if ( $this->section == 'end' ) {
469  $this->checkSection( 'test' );
470  // "input" and "result" are old section names allowed
471  // for backwards-compatibility.
472  $input = $this->checkSection( array( 'wikitext', 'input' ), false );
473  $result = $this->checkSection( array( 'html/php', 'html/*', 'html', 'result' ), false );
474 
475  if ( !isset( $this->sectionData['options'] ) ) {
476  $this->sectionData['options'] = '';
477  }
478 
479  if ( !isset( $this->sectionData['config'] ) ) {
480  $this->sectionData['config'] = '';
481  }
482 
483  if ( $input == false || $result == false ||
484  ( ( preg_match( '/\\bdisabled\\b/i', $this->sectionData['options'] ) && !$this->parserTest->runDisabled )
485  || ( preg_match( '/\\bparsoid\\b/i', $this->sectionData['options'] ) && $result != 'html/php' && !$this->parserTest->runParsoid )
486  || !preg_match( "/" . $this->parserTest->regex . "/i", $this->sectionData['test'] ) )
487  ) {
488  # disabled test
489  $this->clearSection();
490 
491  # Forget any pending hooks call since test is disabled
492  $delayedParserTest->reset();
493 
494  continue;
495  }
496 
497  # We are really going to run the test, run pending hooks and hooks function
498  wfDebug( __METHOD__ . " unleashing delayed test for: {$this->sectionData['test']}" );
499  $hooksResult = $delayedParserTest->unleash( $this->parserTest );
500  if ( !$hooksResult ) {
501  # Some hook reported an issue. Abort.
502  return false;
503  }
504 
505  $this->test = array(
506  'test' => ParserTest::chomp( $this->sectionData['test'] ),
507  'input' => ParserTest::chomp( $this->sectionData[ $input ] ),
508  'result' => ParserTest::chomp( $this->sectionData[ $result ] ),
509  'options' => ParserTest::chomp( $this->sectionData['options'] ),
510  'config' => ParserTest::chomp( $this->sectionData['config'] ),
511  );
512 
513  return true;
514  }
515 
516  if ( isset( $this->sectionData[$this->section] ) ) {
517  throw new MWException( "duplicate section '$this->section' at line {$this->lineNum} of $this->file\n" );
518  }
519 
520  $this->sectionData[$this->section] = '';
521 
522  continue;
523  }
524 
525  if ( $this->section ) {
526  $this->sectionData[$this->section] .= $line;
527  }
528  }
529 
530  return false;
531  }
532 
536  private function clearSection() {
537  $this->sectionData = array();
538  $this->section = null;
539 
540  }
541 
553  private function checkSection( $tokens, $fatal = true ) {
554  if ( is_null( $this->section ) ) {
555  throw new MWException( __METHOD__ . " can not verify a null section!\n" );
556  }
557  if ( !is_array( $tokens ) ) {
558  $tokens = array( $tokens );
559  }
560  if ( count( $tokens ) == 0 ) {
561  throw new MWException( __METHOD__ . " can not verify zero sections!\n" );
562  }
563 
564  $data = $this->sectionData;
565  $tokens = array_filter( $tokens, function ( $token ) use ( $data ) {
566  return isset( $data[ $token ] );
567  } );
568 
569  if ( count( $tokens ) == 0 ) {
570  if ( !$fatal ) {
571  return false;
572  }
573  throw new MWException( sprintf(
574  "'%s' without '%s' at line %s of %s\n",
575  $this->section,
576  implode( ',', $tokens ),
577  $this->lineNum,
578  $this->file
579  ) );
580  }
581  if ( count( $tokens ) > 1 ) {
582  throw new MWException( sprintf(
583  "'%s' with unexpected tokens '%s' at line %s of %s\n",
584  $this->section,
585  implode( ',', $tokens ),
586  $this->lineNum,
587  $this->file
588  ) );
589  }
590 
591  $tokens = array_values( $tokens );
592  return $tokens[ 0 ];
593  }
594 }
595 
600 
602  private $hooks;
603  private $fnHooks;
604 
605  public function __construct() {
606  $this->reset();
607  }
608 
613  public function reset() {
614  $this->hooks = array();
615  $this->fnHooks = array();
616  }
617 
622  public function unleash( &$parserTest ) {
623  if ( !( $parserTest instanceof ParserTest || $parserTest instanceof NewParserTest ) ) {
624  throw new MWException( __METHOD__ . " must be passed an instance of ParserTest or NewParserTest classes\n" );
625  }
626 
627  # Trigger delayed hooks. Any failure will make us abort
628  foreach ( $this->hooks as $hook ) {
629  $ret = $parserTest->requireHook( $hook );
630  if ( !$ret ) {
631  return false;
632  }
633  }
634 
635  # Trigger delayed function hooks. Any failure will make us abort
636  foreach ( $this->fnHooks as $fnHook ) {
637  $ret = $parserTest->requireFunctionHook( $fnHook );
638  if ( !$ret ) {
639  return false;
640  }
641  }
642 
643  # Delayed execution was successful.
644  return true;
645  }
646 
651  public function requireHook( $hook ) {
652  $this->hooks[] = $hook;
653  }
654 
659  public function requireFunctionHook( $fnHook ) {
660  $this->fnHooks[] = $fnHook;
661  }
662 
663 }
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1528
DbTestRecorder\start
start()
Set up result recording; insert a record for the run with the date and all that fun stuff.
Definition: testHelpers.inc:304
wfPercent
wfPercent( $nr, $acc=2, $round=true)
Definition: GlobalFunctions.php:2657
DelayedParserTest
A class to delay execution of a parser test hooks.
Definition: testHelpers.inc:599
DB_MASTER
const DB_MASTER
Definition: Defines.php:56
DbTestRecorder\$version
$version
Definition: testHelpers.inc:298
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
TestFileIterator\rewind
rewind()
Definition: testHelpers.inc:377
TestRecorder\$term
$term
Definition: testHelpers.inc:55
DbTestPreviewer\getTestStatusInfo
getTestStatusInfo( $testname, $after)
Returns a string giving information about when a test last had a status change.
Definition: testHelpers.inc:224
TestRecorder\end
end()
Called at the end of the parser test run.
Definition: testHelpers.inc:72
$ret
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Definition: hooks.txt:1530
DbTestPreviewer\end
end()
Commit transaction and clean up for result recording.
Definition: testHelpers.inc:290
TestFileIterator\__construct
__construct( $file, $parserTest)
Definition: testHelpers.inc:364
TestRecorder\$parent
$parent
Definition: testHelpers.inc:54
DbTestPreviewer\__construct
__construct( $parent)
This should be called before the table prefix is changed.
Definition: testHelpers.inc:111
ITestRecorder\record
record( $test, $result)
Called after each test.
TestFileIterator\key
key()
Definition: testHelpers.inc:394
TestFileIterator\valid
valid()
Definition: testHelpers.inc:407
DelayedParserTest\requireHook
requireHook( $hook)
Similar to ParserTest object but does not run anything Use unleash() to really execute the hook.
Definition: testHelpers.inc:651
file
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing we can concentrate it all in an extension file
Definition: hooks.txt:93
$test
$test
Definition: Utf8Test.php:89
$success
$success
Definition: Utf8Test.php:91
$total
$total
Definition: Utf8Test.php:92
MWException
MediaWiki exception.
Definition: MWException.php:26
DelayedParserTest\reset
reset()
Init/reset or forgot about the current delayed test.
Definition: testHelpers.inc:613
TestFileIterator\next
next()
Definition: testHelpers.inc:398
hooks
Using a hook running we can avoid having all this option specific stuff in our mainline code Using hooks
Definition: hooks.txt:73
DbTestPreviewer\$db
$db
Definition: testHelpers.inc:103
$pre
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped $pre
Definition: hooks.txt:1105
DelayedParserTest\__construct
__construct()
Definition: testHelpers.inc:605
TestRecorder\__construct
__construct( $parent)
Definition: testHelpers.inc:57
TestRecorder
Definition: testHelpers.inc:53
TestFileIterator\clearSection
clearSection()
Clear section name and its data.
Definition: testHelpers.inc:536
DbTestPreviewer\record
record( $test, $result)
Called after each test.
Definition: testHelpers.inc:139
ITestRecorder
Interface to record parser test results.
Definition: testHelpers.inc:37
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
TestRecorder\report
report()
Called before finishing the test run.
Definition: testHelpers.inc:76
TestFileIterator\current
current()
Definition: testHelpers.inc:390
DelayedParserTest\unleash
unleash(&$parserTest)
Called whenever we actually want to run the hook.
Definition: testHelpers.inc:622
ITestRecorder\start
start()
Called at beginning of the parser test run.
TestFileIterator\$fh
$fh
Definition: testHelpers.inc:354
TestFileIterator\$eof
$eof
Definition: testHelpers.inc:362
$line
$line
Definition: cdb.php:57
wfDebug
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:933
DbTestPreviewer
Definition: testHelpers.inc:101
DbTestPreviewer\$lb
$lb
Definition: testHelpers.inc:102
TestFileIterator\$lineNum
$lineNum
Definition: testHelpers.inc:361
$matches
if(!defined( 'MEDIAWIKI')) if(!isset( $wgVersion)) $matches
Definition: NoLocalSettings.php:33
TestFileIterator\$test
$test
Definition: testHelpers.inc:357
TestFileIterator
Definition: testHelpers.inc:352
ITestRecorder\report
report()
Called before finishing the test run.
DbTestPreviewer\start
start()
Set up result recording; insert a record for the run with the date and all that fun stuff.
Definition: testHelpers.inc:123
DelayedParserTest\$hooks
$hooks
Initialized on construction.
Definition: testHelpers.inc:602
TestFileIterator\$file
$file
Definition: testHelpers.inc:353
TestFileIterator\$section
$section
Definition: testHelpers.inc:358
ITestRecorder\end
end()
Called at the end of the parser test run.
TestRecorder\record
record( $test, $result)
Called after each test.
Definition: testHelpers.inc:67
start
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to start
Definition: skin.txt:62
$count
$count
Definition: UtfNormalTest2.php:96
DbTestRecorder
Definition: testHelpers.inc:297
wfGetLBFactory
& wfGetLBFactory()
Get the load balancer factory object.
Definition: GlobalFunctions.php:3669
DbTestPreviewer\$prevRun
$prevRun
Definition: testHelpers.inc:105
DbTestRecorder\record
record( $test, $result)
Record an individual test item's success or failure to the db.
Definition: testHelpers.inc:339
DbTestPreviewer\$curRun
$curRun
Definition: testHelpers.inc:104
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
TestFileIterator\$sectionData
$sectionData
String|null: current test section being analyzed.
Definition: testHelpers.inc:360
TestFileIterator\checkSection
checkSection( $tokens, $fatal=true)
Verify the current section data has some value for the given token name(s) (first parameter).
Definition: testHelpers.inc:553
TestFileIterator\$index
$index
Definition: testHelpers.inc:356
DbTestPreviewer\report
report()
Called before finishing the test run.
Definition: testHelpers.inc:144
term
which are not or by specifying more than one search term(only pages containing all of the search terms will appear in the result).</td >< td >
Definition: All_system_messages.txt:3012
DelayedParserTest\$fnHooks
$fnHooks
Definition: testHelpers.inc:603
TestFileIterator\$parserTest
$parserTest
Definition: testHelpers.inc:355
$failed
$failed
Definition: Utf8Test.php:90
$res
$res
Definition: database.txt:21
DbTestPreviewer\$results
$results
Definition: testHelpers.inc:106
section
section
Definition: parserTests.txt:378
TestRecorder\reportPercentage
reportPercentage( $success, $total)
Definition: testHelpers.inc:84
TestFileIterator\readNextTest
readNextTest()
Definition: testHelpers.inc:411
DelayedParserTest\requireFunctionHook
requireFunctionHook( $fnHook)
Similar to ParserTest object but does not run anything Use unleash() to really execute the hook funct...
Definition: testHelpers.inc:659
TestRecorder\start
start()
Called at beginning of the parser test run.
Definition: testHelpers.inc:62