summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0434.json
blob: eb9c75b102d6e6c6623af0d1fc85cc34874bb354 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
{
	"description": "Test printrequest property chaining `|?Foo.Bar` (#1824, `wgContLang=en`, `wgLang=en`)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has population",
			"contents": "[[Has type::Reference]] [[Has fields::Number;Date;URL]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Capital of",
			"contents": "[[Has type::Page]]"
		},
		{
			"page": "Example/P0434/1",
			"contents": "[[Has population::123;1 Jan 1970;http://example.org/SomeSource]] {{#subobject:Has population=456;1 Jan 2000;http://example.org/SomeSource }} [[Category:P0434]]"
		},
		{
			"page": "Example/P0434/Q1.1",
			"contents": "{{#ask: [[Has population::+]] [[Category:P0434]] |?Has population.Number |link=none}} {{#ask: [[Has population::+]] [[Category:P0434]] |?Has population.Number |link=none |format=debug}}"
		},
		{
			"page": "Example/P0434/Q1.2",
			"contents": "{{#ask: [[Has population::+]] [[Category:P0434]] |?Has population.Date |link=none}}"
		},
		{
			"page": "Example/P0434/2",
			"contents": "[[Capital of::Example/P0434/1]] [[Located in::Example/P0434/3]] [[Category:City]] [[Category:P0434]]"
		},
		{
			"page": "Example/P0434/Q2.1",
			"contents": "{{#ask: [[Category:City]] [[Category:P0434]] |?Capital of.Has population.Number |link=none}}"
		},
		{
			"page": "Example/P0434/3",
			"contents": "[[Located in::Example/P0434/4]] [[Category:Country]] [[Category:P0434]]"
		},
		{
			"page": "Example/P0434/Q3.1",
			"contents": "{{#ask: [[Category:Country]] [[Category:P0434]] |?Located in.-Located in.-Located in.Capital of |link=subject }}"
		},
		{
			"page": "Example/P0434/Q3.2",
			"contents": "{{#ask: [[Category:Country]] [[Category:P0434]] |?Located in.-Located in.-Located in.Capital of=SomeOtherText |link=none }}"
		},
		{
			"page": "Example/P0434/Q3.3",
			"contents": "{{#ask: [[Category:Country]] [[Category:P0434]] |?Located in.-Located in.-Located in.Capital of.Has subobject.Has population.Number |link=none }}"
		},
		{
			"page": "Example/P0434/4",
			"contents": "{{#subobject:Has population=123;1 Jan 2000;http://example.org/SomeSource |@category=P0434-sort }} {{#subobject:Has population=456;1 Jan 1900;http://example.org/SomeSource |@category=P0434-sort}} {{#subobject:Has population=789;1 Jan 1999;http://example.org/SomeSource |@category=P0434-sort}}"
		},
		{
			"page": "Example/P0434/Q4.1",
			"contents": "{{#ask: [[Category:P0434-sort]] |?Has population.Date |sort=Has population.Date |order=asc |link=none}}"
		},
		{
			"page": "Example/P0434/Q4.2",
			"contents": "{{#ask: [[Category:P0434-sort]] |?Has population.Date |sort=Has population.Date |order=desc |link=none}}"
		},
		{
			"page": "Example/P0434/Q4.3",
			"contents": "{{#ask: [[Category:P0434-sort]] |?Has population.Date |sort=Has population.Date,Has population.Number |order=asc,desc |link=none}}"
		},
		{
			"page": "Example/P0434/Q4.4",
			"contents": "{{#ask: [[Category:P0434-sort]] |?Has population.Date |sort=Has population.Date,Has population.Number |order=desc,asc |link=none}}"
		}

	],
	"tests": [
		{
			"type": "parser",
			"about": "#0",
			"subject": "Example/P0434/Q1.1",
			"assert-output": {
				"to-contain": [
					"<td class=\"smwtype_wpg\">Example/P0434/1</td><td class=\"Number smwtype_num\" data-sort-value=\"123\">123</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#1 (1.31-)",
			"skip-on": {
				"mediawiki": [ ">1.30.x", "MediaWiki changed the HTML Tidy" ]
			},
			"subject": "Example/P0434/Q1.2",
			"assert-output": {
				"to-contain": [
					"<td class=\"smwtype_wpg\">Example/P0434/1</td><td class=\"Date smwtype_dat\" data-sort-value=\"2440587.5\">1 January 1970</td></tr></table>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#1 (1.31+)",
			"skip-on": {
				"mediawiki": [ "<1.30.x", "MediaWiki changed the HTML Tidy" ]
			},
			"subject": "Example/P0434/Q1.2",
			"assert-output": {
				"to-contain": [
					"<td class=\"smwtype_wpg\">Example/P0434/1</td><td class=\"Date smwtype_dat\" data-sort-value=\"2440587.5\">1 January 1970</td></tr></tbody></table>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#2 on (?Capital of.Has population.Number)",
			"subject": "Example/P0434/Q2.1",
			"assert-output": {
				"to-contain": [
					"<td class=\"smwtype_wpg\">Example/P0434/2</td><td class=\"Number smwtype_num\" data-sort-value=\"123\">123</td>"
				],
				"not-contain": [
					"<td class=\"smwtype_wpg\">Example/P0434/1</td><td class=\"Number smwtype_num\" data-sort-value=\"123\">123</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#3 on (?Located in.-Located in.-Located in.Capital of)",
			"subject": "Example/P0434/Q3.1",
			"assert-output": {
				"to-contain": [
					"<td class=\"Capital-of smwtype_wpg\">Example/P0434/1</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#4 on (?Located in.-Located in.-Located in.Capital of=SomeOtherText)",
			"subject": "Example/P0434/Q3.2",
			"assert-output": {
				"to-contain": [
					"SomeOtherText</a>&#160;<span title=\"Located in.-Located in.-Located in.Capital of\">⠉</span>",
					"<td class=\"SomeOtherText smwtype_wpg\">Example/P0434/1</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#5 on (?Located in.-Located in.-Located in.Capital of.Has subobject.Has population.Number)",
			"subject": "Example/P0434/Q3.3",
			"assert-output": {
				"to-contain": [
					"<span title=\"Located in.-Located in.-Located in.Capital of.Has subobject.Has population.Number\">⠉</span>",
					"<td class=\"smwtype_wpg\">Example/P0434/3</td><td class=\"Number smwtype_num\" data-sort-value=\"456\">456</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#6 (sort=Has population.Date, order=asc) ",
			"subject": "Example/P0434/Q4.1",
			"assert-output": {
				"to-contain": [
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\">Example/P0434/4#_357f4a06073b86afc07cb0c6237b9f36</td><td class=\"Date smwtype_dat\" data-sort-value=\"2415020.5\">1 January 1900</td></tr>",
					"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\">Example/P0434/4#_eb1c9a9f3a8ad677d7424e8d842b10dd</td><td class=\"Date smwtype_dat\" data-sort-value=\"2451179.5\">1 January 1999</td></tr>",
					"<tr data-row-number=\"3\" class=\"row-odd\"><td class=\"smwtype_wpg\">Example/P0434/4#_4bae31c0cd5bda46c3cf0245523a954a</td><td class=\"Date smwtype_dat\" data-sort-value=\"2451544.5\">1 January 2000</td></tr>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#7 (sort=Has population.Date, order=desc) ",
			"subject": "Example/P0434/Q4.2",
			"assert-output": {
				"to-contain": [
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\">Example/P0434/4#_4bae31c0cd5bda46c3cf0245523a954a</td><td class=\"Date smwtype_dat\" data-sort-value=\"2451544.5\">1 January 2000</td></tr>",
					"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\">Example/P0434/4#_eb1c9a9f3a8ad677d7424e8d842b10dd</td><td class=\"Date smwtype_dat\" data-sort-value=\"2451179.5\">1 January 1999</td></tr>",
					"<tr data-row-number=\"3\" class=\"row-odd\"><td class=\"smwtype_wpg\">Example/P0434/4#_357f4a06073b86afc07cb0c6237b9f36</td><td class=\"Date smwtype_dat\" data-sort-value=\"2415020.5\">1 January 1900</td></tr>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#8 (Has population.Date,Has population.Number, order=asc,desc) ",
			"subject": "Example/P0434/Q4.3",
			"assert-output": {
				"to-contain": [
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\">Example/P0434/4#_357f4a06073b86afc07cb0c6237b9f36</td><td class=\"Date smwtype_dat\" data-sort-value=\"2415020.5\">1 January 1900</td></tr>",
					"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\">Example/P0434/4#_eb1c9a9f3a8ad677d7424e8d842b10dd</td><td class=\"Date smwtype_dat\" data-sort-value=\"2451179.5\">1 January 1999</td></tr>",
					"<tr data-row-number=\"3\" class=\"row-odd\"><td class=\"smwtype_wpg\">Example/P0434/4#_4bae31c0cd5bda46c3cf0245523a954a</td><td class=\"Date smwtype_dat\" data-sort-value=\"2451544.5\">1 January 2000</td></tr>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#9 (Has population.Date,Has population.Number, order=desc,asc) ",
			"subject": "Example/P0434/Q4.4",
			"assert-output": {
				"to-contain": [
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\">Example/P0434/4#_4bae31c0cd5bda46c3cf0245523a954a</td><td class=\"Date smwtype_dat\" data-sort-value=\"2451544.5\">1 January 2000</td></tr>",
					"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\">Example/P0434/4#_eb1c9a9f3a8ad677d7424e8d842b10dd</td><td class=\"Date smwtype_dat\" data-sort-value=\"2451179.5\">1 January 1999</td></tr>",
					"<tr data-row-number=\"3\" class=\"row-odd\"><td class=\"smwtype_wpg\">Example/P0434/4#_357f4a06073b86afc07cb0c6237b9f36</td><td class=\"Date smwtype_dat\" data-sort-value=\"2415020.5\">1 January 1900</td></tr>"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgPageSpecialProperties": [
			"_MDAT"
		]
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}