# The parsoid-compatible option below is only relevant when we are running # parser tests in integrated mode with Parsoid. This option is ignored # when this test file is run with Parsoid in standalone mode. !! options parsoid-compatible=wt2html,wt2wt version=2 !! end # Note that the current date is hard-coded as # 1970-01-01T00:02:03Z (a Thursday) # when running parser tests. The timezone is also fixed to GMT, so # local date will be identical to current date. !! test Magic Word: {{CURRENTDAY}} !! wikitext {{CURRENTDAY}} !! html/php

1

!! html/parsoid+integrated

1

!! end !! test Magic Word: {{CURRENTDAY2}} !! wikitext {{CURRENTDAY2}} !! html/php

01

!! html/parsoid+integrated

01

!! end !! test Magic Word: {{CURRENTDAYNAME}} !! wikitext {{CURRENTDAYNAME}} !! html/php

Thursday

!! html/parsoid+integrated

Thursday

!! end !! test Magic Word: {{CURRENTDOW}} !! wikitext {{CURRENTDOW}} !! html/php

4

!! html/parsoid+integrated

4

!! end !! test Magic Word: {{CURRENTMONTH}} !! wikitext {{CURRENTMONTH}} !! html/php

01

!! html/parsoid+integrated

01

!! end !! test Magic Word: {{CURRENTMONTH1}} !! wikitext {{CURRENTMONTH1}} !! html/php

1

!! html/parsoid+integrated

1

!! end !! test Magic Word: {{CURRENTMONTHABBREV}} !! wikitext {{CURRENTMONTHABBREV}} !! html/php

Jan

!! html/parsoid+integrated

Jan

!! end !! test Magic Word: {{CURRENTMONTHNAME}} !! wikitext {{CURRENTMONTHNAME}} !! html/php

January

!! html/parsoid+integrated

January

!! end !! test Magic Word: {{CURRENTMONTHNAMEGEN}} !! wikitext {{CURRENTMONTHNAMEGEN}} !! html/php

January

!! html/parsoid+integrated

January

!! end !! test Magic Word: {{CURRENTTIME}} !! wikitext {{CURRENTTIME}} !! html/php

00:02

!! html/parsoid+integrated

00:02

!! end !! test Magic Word: {{CURRENTHOUR}} !! wikitext {{CURRENTHOUR}} !! html/php

00

!! html/parsoid+integrated

00

!! end !! test Magic Word: {{CURRENTWEEK}} (T6594) !! wikitext {{CURRENTWEEK}} !! html/php

1

!! html/parsoid+integrated

1

!! end !! test Magic Word: {{CURRENTYEAR}} !! wikitext {{CURRENTYEAR}} !! html/php

1970

!! html/parsoid+integrated

1970

!! end !! test Magic Word: {{CURRENTTIMESTAMP}} !! wikitext {{CURRENTTIMESTAMP}} !! html/php

19700101000203

!! html/parsoid+integrated

19700101000203

!! end !! test Magic Words LOCAL (UTC) !! wikitext *{{LOCALMONTH}} *{{LOCALMONTH1}} *{{LOCALMONTHNAME}} *{{LOCALMONTHNAMEGEN}} *{{LOCALMONTHABBREV}} *{{LOCALDAY}} *{{LOCALDAY2}} *{{LOCALDAYNAME}} *{{LOCALYEAR}} *{{LOCALTIME}} *{{LOCALHOUR}} *{{LOCALWEEK}} *{{LOCALDOW}} *{{LOCALTIMESTAMP}} !! html/php !! html/parsoid+integrated !! end !! test Magic Word: {{FULLPAGENAME}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{FULLPAGENAME}} !! html/php

User:Ævar Arnfjörð Bjarmason

!! html/parsoid+integrated

User:Ævar Arnfjörð Bjarmason

!! end !! test Magic Word: {{FULLPAGENAMEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{FULLPAGENAMEE}} !! html/php

User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! html/parsoid+integrated

User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end !! test Magic Word: {{TALKSPACE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{TALKSPACE}} !! html/php

User talk

!! html/parsoid+integrated

User talk

!! end !! test Magic Word: {{TALKSPACE}}, same namespace !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{TALKSPACE}} !! html/php

User talk

!! html/parsoid+integrated

User talk

!! end !! test Magic Word: {{TALKSPACE}}, main namespace !! options title=[[Parser Test]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{TALKSPACE}} !! html/php

Talk

!! html/parsoid+integrated

Talk

!! end !! test Magic Word: {{TALKSPACEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{TALKSPACEE}} !! html/php

User_talk

!! html/parsoid+integrated

User_talk

!! end !! test Magic Word: {{SUBJECTSPACE}} !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{SUBJECTSPACE}} !! html/php

User

!! html/parsoid+integrated

User

!! end !! test Magic Word: {{SUBJECTSPACE}}, same namespace !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{SUBJECTSPACE}} !! html/php

User

!! html/parsoid+integrated

User

!! end !! test Magic Word: {{SUBJECTSPACE}}, main namespace !! options title=[[Parser Test]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{SUBJECTSPACE}} !! html/php !! html/parsoid+integrated !! end !! test Magic Word: {{SUBJECTSPACEE}} !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{SUBJECTSPACEE}} !! html/php

User

!! html/parsoid+integrated

User

!! end !! test Magic Word: {{NAMESPACE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{NAMESPACE}} !! html/php

User

!! html/parsoid+integrated

User

!! end !! test Magic Word: {{NAMESPACEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{NAMESPACEE}} !! html/php

User

!! html/parsoid+integrated

User

!! end !! test Magic Word: {{NAMESPACENUMBER}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{NAMESPACENUMBER}} !! html/php

2

!! html/parsoid+integrated

2

!! end !! test Magic Word: {{SUBPAGENAME}} !! options title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{SUBPAGENAME}} !! html/php

sub ö

!! html/parsoid+integrated

sub ö

!! end !! test Magic Word: {{SUBPAGENAMEE}} !! options title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{SUBPAGENAMEE}} !! html/php

sub_%C3%B6

!! html/parsoid+integrated

sub_%C3%B6

!! end !! test Magic Word: {{ROOTPAGENAME}} !! options title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{ROOTPAGENAME}} !! html/php

Ævar Arnfjörð Bjarmason

!! html/parsoid+integrated

Ævar Arnfjörð Bjarmason

!! end !! test Magic Word: {{ROOTPAGENAMEE}} !! options title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{ROOTPAGENAMEE}} !! html/php

%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! html/parsoid+integrated

%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end !! test Magic Word: {{BASEPAGENAME}} !! options title=[[Ævar Arnfjörð Bjarmason/sub]] subpage parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{BASEPAGENAME}} !! html/php

Ævar Arnfjörð Bjarmason

!! html/parsoid+integrated

Ævar Arnfjörð Bjarmason

!! end !! test Magic Word: {{BASEPAGENAMEE}} !! options title=[[Ævar Arnfjörð Bjarmason/sub]] subpage parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{BASEPAGENAMEE}} !! html/php

%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! html/parsoid+integrated

%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end !! test Magic Word: {{TALKPAGENAME}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{TALKPAGENAME}} !! html/php

User talk:Ævar Arnfjörð Bjarmason

!! html/parsoid+integrated

User talk:Ævar Arnfjörð Bjarmason

!! end !! test Magic Word: {{TALKPAGENAMEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{TALKPAGENAMEE}} !! html/php

User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! html/parsoid+integrated

User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end !! test Magic Word: {{SUBJECTPAGENAME}} !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBJECTPAGENAME}} !! html/php

User:Ævar Arnfjörð Bjarmason

!! html/parsoid+integrated

User:Ævar Arnfjörð Bjarmason

!! end !! test Magic Word: {{SUBJECTPAGENAMEE}} !! options title=[[User talk:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SUBJECTPAGENAMEE}} !! html/php

User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! html/parsoid+integrated

User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end !! test Magic Word: {{NUMBEROFFILES}} !! options parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{NUMBEROFFILES}} !! html/php

7

!! html/parsoid+integrated

7

!! end !! test Magic Word: {{PAGENAME}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext {{PAGENAME}} !! html/php

Ævar Arnfjörð Bjarmason

!! html/parsoid+integrated

Ævar Arnfjörð Bjarmason

!! end !! test Magic Word: {{PAGENAME}} with metacharacters !! options title=[['foo & bar = baz']] parsoid={ "modes": ["wt2html","wt2wt"] } !! wikitext ''{{PAGENAME}}'' !! html/php

'foo & bar = baz'

!! html/parsoid+integrated

'foo & bar = baz'

!! end !! test Magic Word: {{PAGENAME}} with metacharacters (T28781) !! options title=[[*RFC 1234 http://example.com/]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGENAME}} !! html/php

*RFC 1234 http://example.com/

!! html/parsoid+integrated

*RFC 1234 http://example.com/

!! end !! test Magic Word: {{PAGENAMEE}} !! options title=[[User:Ævar Arnfjörð Bjarmason]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGENAMEE}} !! html/php

%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! html/parsoid+integrated

%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

!! end !! test Magic Word: {{PAGENAMEE}} with metacharacters (T28781) !! options title=[[*RFC 1234 http://example.com/]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGENAMEE}} !! html/php

*RFC_1234_http://example.com/

!! html/parsoid+integrated

*RFC_1234_http://example.com/

!! end !! test Magic Word: {{REVISIONID}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"] } showflags !! wikitext {{REVISIONID}} !! metadata/integrated flags=vary-revision-id !! html/php

1337

!! html/parsoid+integrated

1337

!! end !! test Magic Word: {{REVISIONID}} on non-latest revision !! options parsoid={ "modes": ["wt2html","wt2wt"] } showflags !! wikitext {{REVISIONID}} !! metadata/integrated flags=vary-revision-id !! html/php

1337

!! html/parsoid+integrated

1337

!! end !! test Magic Word: {{REVISIONTIMESTAMP}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONTIMESTAMP}} !! metadata/integrated flags= !! html/php

19700101000203

!! html/parsoid+integrated

19700101000203

!! end !! test Magic Word: {{REVISIONTIMESTAMP:{{PAGENAME}}}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONTIMESTAMP:{{PAGENAME}}}} !! metadata/integrated flags= !! html/php

19700101000203

!! html/parsoid+integrated

19700101000203

!! end !! test Magic Word: {{REVISIONTIMESTAMP}} on not-yet-existing current page !! options title=[[This page does not exist]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONTIMESTAMP}} !! metadata/integrated flags=vary-revision-timestamp !! html/php

19700101000203

!! html/parsoid+integrated

19700101000203

!! end !! test Magic Word: {{REVISIONTIMESTAMP:{{PAGENAME}}}} on not-yet-existing current page !! options title=[[This page does not exist]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONTIMESTAMP:{{PAGENAME}}}} !! metadata/integrated flags=vary-revision-timestamp !! html/php

19700101000203

!! html/parsoid+integrated

19700101000203

!! end !! test Magic Word: {{REVISIONTIMESTAMP:...}}} on non-existing non-current page !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONTIMESTAMP:This page does not exist}} !! metadata/integrated flags= !! html/php !! html/parsoid+integrated !! end !! test Magic Word: {{REVISIONUSER}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONUSER}} !! metadata/integrated flags=vary-user !! html/php

127.0.0.1

!! html/parsoid+integrated

127.0.0.1

!! end !! test Magic Word: {{REVISIONUSER}} on not-yet-existing current page !! options title=[[This page does not exist]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONUSER}} !! metadata/integrated flags=vary-user !! html/php !! html/parsoid+integrated !! end !! test Magic Word: {{REVISIONUSER:{{PAGENAME}}}} on not-yet-existing current page !! options title=[[This page does not exist]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONUSER:{{PAGENAME}}}} !! metadata/integrated flags=vary-user !! html/php !! html/parsoid+integrated !! end !! test Magic Word: {{REVISIONUSER:...}} on non-existing non-current page !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONUSER:This page does not exist}} !! metadata/integrated flags= !! html/php !! html/parsoid+integrated !! end !! test Magic Word: {{REVISIONUSER}} on non-latest revision !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONUSER}} !! metadata/integrated flags=vary-user !! html/php !! html/parsoid+integrated !! end !! test Parser Function: {{REVISIONID:{{PAGENAME}}}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"] } showflags !! wikitext {{REVISIONID:{{PAGENAME}}}} !! metadata/integrated flags=vary-revision-id !! html/php

1337

!! html/parsoid+integrated

1337

!! end !! test Parser Function: {{REVISIONID:{{PAGENAME}}}} on non-saved revision !! options parsoid={ "modes": ["wt2html","wt2wt"] } showflags !! wikitext {{REVISIONID:{{PAGENAME}}}} !! metadata/integrated flags=vary-revision-id !! html/php !! html/parsoid+integrated !! end !! test Parser Function: {{REVISIONDAY}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONDAY}} !! metadata/integrated flags= !! html/php

1

!! html/parsoid+integrated

1

!! end !! test Parser Function: {{REVISIONDAY:{{PAGENAME}}}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"] } showflags !! wikitext {{REVISIONDAY:{{PAGENAME}}}} !! metadata/integrated flags= !! html/php

1

!! html/parsoid+integrated

1

!! end !! test Parser Function: {{REVISIONMONTH}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } showflags !! wikitext {{REVISIONMONTH}} !! metadata/integrated flags= !! html/php

01

!! html/parsoid+integrated

01

!! end !! test Parser Function: {{REVISIONMONTH:{{PAGENAME}}}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"] } showflags !! wikitext {{REVISIONMONTH:{{PAGENAME}}}} !! metadata/integrated flags= !! html/php

01

!! html/parsoid+integrated

01

!! end !! test Parser Function: {{REVISIONYEAR:{{PAGENAME}}}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"] } showflags !! wikitext {{REVISIONYEAR:{{PAGENAME}}}} !! metadata/integrated flags= !! html/php

1970

!! html/parsoid+integrated

1970

!! end !! test Parser Function: {{PAGESIZE:{{PAGENAME}}}} on latest revision !! options lastsavedrevision parsoid={ "modes": ["wt2html","wt2wt"] } showflags !! wikitext {{PAGESIZE:{{PAGENAME}}}} !! metadata/integrated flags=vary-revision-sha1 !! html/php

25

!! html/parsoid+integrated

25

!! end !! test Magic Word: {{SCRIPTPATH}} !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SCRIPTPATH}} !! html/php !! html/parsoid+integrated !! end !! test Magic Word: {{STYLEPATH}} !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{STYLEPATH}} !! html/php

/skins

!! html/parsoid+integrated

/skins

!! end !! test Magic Word: {{SERVER}} !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SERVER}} !! html/*

http://example.org

!! end !! test Magic Word: {{SERVERNAME}} !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SERVERNAME}} !! html/*

example.org

!! end !! test Magic Word: {{SITENAME}} !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{SITENAME}} !! html/*

MediaWiki

!! end !! test Magic Word: {{PAGELANGUAGE}} !! options language=fr parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGELANGUAGE}} !! html/*

fr

!! end !! test Magic Word: {{PAGELANGUAGE}} on a page with no explicitly set language !! options parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGELANGUAGE}} !! html/*

en

!! end !! test Case-sensitive magic words, when cased differently, should just be template transclusions !! wikitext {{CurrentMonth}} {{currentday}} {{cURreNTweEK}} {{currentHour}} !! html/php

Template:CurrentMonth Template:Currentday Template:CURreNTweEK Template:CurrentHour

!! html/parsoid

Template:CurrentMonth Template:Currentday Template:CURreNTweEK Template:CurrentHour

!! end !! test Case-insensitive magic words should still work with weird casing. !! wikitext {{sErVeRNaMe}} {{LCFirst:AOEU}} {{ucFIRST:aoeu}} {{SERver}} !! html

example.org aOEU Aoeu http://example.org

!! end