summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0431.json
blob: e9c1c1f03aa8d13ef1e141bd31c05c3c6cc8a233 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
	"description": "Test in-text annotation `_rec` and `|+index` (`wgContLang=en`, `wgLang=en`)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has text",
			"contents": "[[Has type::Text]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has number",
			"contents": "[[Has type::Number]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has record",
			"contents": "[[Has type::Record]] [[Has fields::Has text;Has number]] [[Has property description::Test@en]]"
		},
		{
			"page": "Example/P0431/1",
			"contents": "[[Has record::Foo;123]]"
		},
		{
			"page": "Example/P0431/Q1.1",
			"contents": "{{#ask: [[Has record::+]] |?Has record|+index=Has text}}"
		},
		{
			"page": "Example/P0431/Q1.2",
			"contents": "{{#ask: [[Has record::+]] |?Has record|+index=Has number|?Has record|+index=Has text}}"
		},
		{
			"page": "Example/P0431/Q2.1",
			"contents": "{{#ask: [[Has property description::Test@en]] |?Has property description|+index=Language code}}"
		}
	],
	"tests": [
		{
			"type": "parser",
			"about": "#0",
			"subject": "Example/P0431/Q1.1",
			"assert-output": {
				"to-contain": [
					"Example/P0431/1",
					"<td class=\"Has-record smwtype_txt\">Foo</td>"
				],
				"not-contain": [
					"<td class=\"Has-record smwtype_num\" data-sort-value=\"123\">123</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#1",
			"subject": "Example/P0431/Q1.2",
			"assert-output": {
				"to-contain": [
					"Example/P0431/1",
					"<td class=\"Has-record smwtype_txt\">Foo</td>",
					"<td class=\"Has-record smwtype_num\" data-sort-value=\"123\">123</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#2",
			"subject": "Example/P0431/Q2.1",
			"assert-output": {
				"to-contain": [
					"Property:Has record",
					"<td class=\"Property-description smwtype&#95;_lcode\">en</td>"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en"
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}