Add logic to ParserTestRunner to allow testing of ParserOutput flags,
and use it in the existing {{REVISIONID}} test, and for the added
flag for user-signature from I77de05849c (T84843).
Change-Id: I96e3d050e17a2d7e3d0478c702ecd53310259f56
if ( isset( $opts['pst'] ) ) {
$out = $parser->preSaveTransform( $test['input'], $title, $user, $options );
if ( isset( $opts['pst'] ) ) {
$out = $parser->preSaveTransform( $test['input'], $title, $user, $options );
+ $output = $parser->getOutput();
} elseif ( isset( $opts['msg'] ) ) {
$out = $parser->transformMsg( $test['input'], $options, $title );
} elseif ( isset( $opts['section'] ) ) {
} elseif ( isset( $opts['msg'] ) ) {
$out = $parser->transformMsg( $test['input'], $options, $title );
} elseif ( isset( $opts['section'] ) ) {
+ if ( isset( $output ) && isset( $opts['showflags'] ) ) {
+ $actualFlags = array_keys( TestingAccessWrapper::newFromObject( $output )->mFlags );
+ sort( $actualFlags );
+ $out .= "\nflags=" . join( ', ', $actualFlags );
+ }
+
ScopedCallback::consume( $teardownGuard );
$expected = $test['result'];
ScopedCallback::consume( $teardownGuard );
$expected = $test['result'];
Magic Word: {{REVISIONID}}
!! options
parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
Magic Word: {{REVISIONID}}
!! options
parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{REVISIONID}}
!! html/*
<p>1337
</p>
!! wikitext
{{REVISIONID}}
!! html/*
<p>1337
</p>
+!! test
+ParserOutput flags from signature expansion (T84843)
+!! options
+pst
+showflags
+!! wikitext
+~~~~
+!! html/php
+[[Special:Contributions/127.0.0.1|127.0.0.1]] 00:02, 1 January 1970 (UTC)
+flags=user-signature
+!! end
+
+
!! test
pre-save transform: Signature expansion in nowiki tags (T2093)
!! options
!! test
pre-save transform: Signature expansion in nowiki tags (T2093)
!! options