summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0916.json
blob: 6244483a3f03ef3e41e09ab742f0b3282ed6096a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
	"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": "WD reference",
			"contents": "[[Has type::Reference]] [[Has fields::URL;WDID]]"
		},
		{
			"page": "Example/P0916/1",
			"contents": "[[WD reference::https://en.wikipedia.org/wiki/Franz_Schubert;Q7312]]"
		}
	],
	"tests": [
		{
			"type": "parser",
			"about": "#0 (correct formatting for external identifier)",
			"subject": "Example/P0916/1",
			"assert-store": {
				"semantic-data": {
					"strict-mode-valuematch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_MDAT",
						"_SKEY",
						"WD reference"
					]
				}
			},
			"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>\">"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgPageSpecialProperties": [
			"_MDAT"
		],
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}