gplx/mediawiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0916.json

176 lines
5.9 KiB
JSON

{
"description": "Test `_ref_rec` with a `_eid` field (#2985)",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "WDID",
"contents": "[[Has type::External identifier]][[External formatter uri::https://www.wikidata.org/entity/$1]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "wikipedia",
"contents": "[[Has type::External identifier]][[External formatter uri::https://en.wikipedia.org/w/index.php?title=$1&oldid=$2]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has page",
"contents": "[[Has type::Page]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "WD reference (url,eid)",
"contents": "[[Has type::Reference]] [[Has fields::URL;WDID]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "WD reference (eid,url)",
"contents": "[[Has type::Reference]] [[Has fields::WDID;URL]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "WD reference (wpg,eid,url)",
"contents": "[[Has type::Reference]] [[Has fields::Has page;WDID;URL]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Wikipedia reference",
"contents": "[[Has type::Reference]] [[Has fields::Number;wikipedia]]"
},
{
"page": "Franz Schubert",
"contents": "[[WD reference (url,eid)::https://en.wikipedia.org/wiki/Franz_Schubert;Q7312]]"
},
{
"page": "P0916/1",
"contents": "[[WD reference (url,eid)::https://en.wikipedia.org/wiki/Franz_Schubert;Q7312]]"
},
{
"page": "P0916/Q.1.1",
"contents": "{{#show: P0916/1 |?WD reference (url,eid) }}"
},
{
"page": "P0916/2",
"contents": "[[Wikipedia reference::837787373;Truid Aagesen{837787373}]]"
},
{
"page": "P0916/3",
"contents": "[[WD reference (eid,url)::Q7312;https://en.wikipedia.org/wiki/Franz_Schubert]]"
},
{
"page": "P0916/Q.3.1",
"contents": "{{#show: P0916/3 |?WD reference (eid,url) }}"
},
{
"page": "P0916/4",
"contents": "[[WD reference (wpg,eid,url)::Franz Schubert;Q7312;https://en.wikipedia.org/wiki/Franz_Schubert]]"
},
{
"page": "P0916/Q.4.1",
"contents": "{{#show: P0916/4 |?WD reference (wpg,eid,url) }}"
}
],
"tests": [
{
"type": "parser",
"about": "#0 (reference with url,eid)",
"subject": "P0916/1",
"assert-store": {
"semantic-data": {
"strict-mode-valuematch": false,
"propertyCount": 3,
"propertyKeys": [
"_MDAT",
"_SKEY",
"WD reference (url,eid)"
]
}
},
"assert-output": {
"to-contain": [
"data-content=\"<ul><li><a href=".*:WDID"",
"title=".*:WDID">WDID</a>: <a href="https://www.wikidata.org/entity/Q7312" target="_blank">Q7312</a></li></ul>\" title=\"WDID: Q7312\">"
],
"not-contain": [
"title=&quot;.*:WDID&quot;&gt;WDID&lt;/a&gt;: &lt;span class=&quot;plainlinks smw-eid&quot;&gt;<a rel=\"nofollow\" class=\"external text\" href=\"https://www.wikidata.org/entity/Q7312\">Q7312</a>&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;\" title=\"WDID: <a rel=\"nofollow\" class=\"external text\" href=\"https://www.wikidata.org/entity/Q7312\">Q7312</a>\">"
]
}
},
{
"type": "parser",
"about": "#1 (reference with url,eid)",
"subject": "P0916/2",
"assert-store": {
"semantic-data": {
"strict-mode-valuematch": false,
"propertyCount": 3,
"propertyKeys": [
"_MDAT",
"_SKEY",
"Wikipedia reference"
]
}
},
"assert-output": {
"to-contain": [
"Wikipedia&quot;&gt;Wikipedia&lt;/a&gt;: &lt;a href=&quot;https://en.wikipedia.org/w/index.php?title=Truid_Aagesen&amp;amp;oldid=837787373&quot; target=&quot;_blank&quot;&gt;Truid Aagesen"
]
}
},
{
"type": "parser",
"about": "#2 (#show reference with url,eid)",
"subject": "P0916/Q.1.1",
"assert-output": {
"to-contain": [
"<p><a rel=\"nofollow\" class=\"external text\" href=\"https://en.wikipedia.org/wiki/Franz_Schubert\">https://en.wikipedia.org/wiki/Franz Schubert</a>",
"data-content=\"&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;.*WDID&quot; title=&quot;.*WDID&quot;&gt;WDID&lt;/a&gt;: &lt;a",
"href=&quot;https&#58;//www.wikidata.org/entity/Q7312&quot; target=&quot;_blank&quot;&gt;Q7312&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;\""
]
}
},
{
"type": "parser",
"about": "#3 (#show reference with eid,url)",
"subject": "P0916/Q.3.1",
"assert-output": {
"to-contain": [
"<p><span class=\"plainlinks smw-eid\"><a rel=\"nofollow\" class=\"external text\" href=\"https://www.wikidata.org/entity/Q7312\">Q7312</a></span>",
"data-content=\"&lt;ul&gt;&lt;li&gt;&lt;a",
"href=&quot;.*URL&quot; title=&quot;.*URL&quot;&gt;URL&lt;/a&gt;: &lt;a class=&quot;external&quot; rel=&quot;nofollow&quot;",
"href=&quot;https&#58;//en.wikipedia.org/wiki/Franz_Schubert&quot;&gt;https&#58;//en.wikipedia.org/wiki/Franz Schubert&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;\""
]
}
},
{
"type": "parser",
"about": "#4 (#show reference with wpg,eid,url)",
"subject": "P0916/Q.4.1",
"assert-output": {
"to-contain": [
"<p><a href=\".*Franz_Schubert\" title=\"Franz Schubert\">Franz Schubert</a>",
"data-content=\"&lt;ul&gt;&lt;li&gt;&lt;a",
"href=&quot;.*WDID&quot; title=&quot;.*WDID&quot;&gt;WDID&lt;/a&gt;: &lt;a",
"href=&quot;https&#58;//www.wikidata.org/entity/Q7312&quot; target=&quot;_blank&quot;&gt;Q7312&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a",
"href=&quot;.*URL&quot; title=&quot;.*URL&quot;&gt;URL&lt;/a&gt;: &lt;a class=&quot;external&quot; rel=&quot;nofollow&quot;",
"href=&quot;https&#58;//en.wikipedia.org/wiki/Franz_Schubert&quot;&gt;https&#58;//en.wikipedia.org/wiki/Franz Schubert&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;\""
]
}
}
],
"settings": {
"wgContLang": "en",
"wgLang": "en",
"smwgPageSpecialProperties": [
"_MDAT"
],
"smwgNamespacesWithSemanticLinks": {
"NS_MAIN": true,
"SMW_NS_PROPERTY": true
}
},
"meta": {
"version": "2",
"is-incomplete": false,
"debug": false
}
}