summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/TestCases/tree-01.json
blob: 83f0a28a56d0a46b43b7b924502f1eac4a532680 (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
216
217
218
219
220
221
222
{
	"description": "Tree format: Multi-page results",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has parent",
			"contents": "[[Has type::Page]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Part of",
			"contents": "[[Has type::Text]]"
		},
		{
			"page": "Example/Tree 1",
			"contents": "<!-- No parent -->[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 2",
			"contents": "<!-- No parent -->[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 3",
			"contents": "<!-- No parent -->[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 11",
			"contents": "[[Has parent::Example/Tree 1]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 12",
			"contents": "[[Has parent::Example/Tree 1]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 13",
			"contents": "[[Has parent::Example/Tree 1]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 21",
			"contents": "[[Has parent::Example/Tree 2]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 22",
			"contents": "[[Has parent::Example/Tree 2]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 31",
			"contents": "[[Has parent::Example/Tree 3]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 32",
			"contents": "[[Has parent::Example/Tree 3]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 33",
			"contents": "[[Has parent::Example/Tree 3]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 121",
			"contents": "[[Has parent::Example/Tree 12]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 321",
			"contents": "[[Has parent::Example/Tree 32]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 01-01",
			"contents": "{{#ask:[[Part of::Tree test]]|format=tree|parent=Has parent}}"
		},
		{
			"page": "Example/Tree 01-02",
			"contents": "{{#ask:[[Part of::Tree test]]|format=tree|parent=Has parent|root=Example/Tree 1}}"
		},
		{
			"page": "Example/Tree 01-03",
			"contents": "{{#ask:[[Part of::Tree test]]|format=ultree|parent=Has parent}}"
		},
		{
			"page": "Example/Tree 01-04",
			"contents": "{{#ask:[[Part of::Tree test]]|format=ultree|parent=Has parent|root=Example/Tree 3}}"
		},
		{
			"page": "Example/Tree 01-05",
			"contents": "{{#ask:[[Part of::Tree test]]|format=oltree|parent=Has parent}}"
		},
		{
			"page": "Example/Tree 01-06",
			"contents": "{{#ask:[[Part of::Tree test]]|format=oltree|parent=Has parent|root=Example/Tree 2}}"
		}
	],
	"tests": [
		{
			"type": "parser-html",
			"about": "Tree 01-01 (Multi-page result)",
			"subject": "Example/Tree 01-01",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 11\"]:only-child",
					"div.srf-tree > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",
					"div.srf-tree > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 13\"]:only-child",

					"div.srf-tree > ul > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 21\"]:only-child",
					"div.srf-tree > ul > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 22\"]:only-child",

					"div.srf-tree > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 31\"]:only-child",
					"div.srf-tree > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 32\"] + ul > li:only-child > a[title=\"Example/Tree 321\"]:only-child",
					"div.srf-tree > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 33\"]:only-child",

					[ "div.srf-tree > ul:only-child", 1 ],
					[ "div.srf-tree > ul > li", 3 ],
					[ "div.srf-tree > ul > li > ul > li", 8 ],
					[ "div.srf-tree > ul > li > ul > li > ul > li", 2 ]
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 01-02 (Multi-page result with root specified)",
			"subject": "Example/Tree 01-02",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ul > li:only-child > a[title=\"Example/Tree 1\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 11\"]:only-child",
					"div.srf-tree > ul > li:only-child > a[title=\"Example/Tree 1\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",
					"div.srf-tree > ul > li:only-child > a[title=\"Example/Tree 1\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 13\"]:only-child",

					[ "div.srf-tree > ul > li", 1 ],
					[ "div.srf-tree > ul > li > ul > li", 3 ],
					[ "div.srf-tree > ul > li > ul > li > ul > li", 1 ]
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 01-03 (Multi-page result (ultree))",
			"subject": "Example/Tree 01-03",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 11\"]:only-child",
					"div.srf-tree > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",
					"div.srf-tree > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 13\"]:only-child",

					"div.srf-tree > ul > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 21\"]:only-child",
					"div.srf-tree > ul > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 22\"]:only-child",

					"div.srf-tree > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 31\"]:only-child",
					"div.srf-tree > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 32\"] + ul > li:only-child > a[title=\"Example/Tree 321\"]:only-child",
					"div.srf-tree > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 33\"]:only-child",

					[ "div.srf-tree > ul > li", 3 ],
					[ "div.srf-tree > ul > li > ul > li", 8 ],
					[ "div.srf-tree > ul > li > ul > li > ul > li", 2 ]
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 01-04 (Multi-page result with root specified (ultree))",
			"subject": "Example/Tree 01-04",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ul > li:only-child > a[title=\"Example/Tree 3\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 31\"]:only-child",
					"div.srf-tree > ul > li:only-child > a[title=\"Example/Tree 3\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 32\"] + ul > li:only-child > a[title=\"Example/Tree 321\"]:only-child",
					"div.srf-tree > ul > li:only-child > a[title=\"Example/Tree 3\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 33\"]:only-child",

					[ "div.srf-tree > ul > li", 1 ],
					[ "div.srf-tree > ul > li > ul > li", 3 ],
					[ "div.srf-tree > ul > li > ul > li > ul > li", 1 ]
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 01-05 (Multi-page result (oltree))",
			"subject": "Example/Tree 01-05",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ol > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ol > li:nth-child(1) > a[title=\"Example/Tree 11\"]:only-child",
					"div.srf-tree > ol > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ol > li:nth-child(2) > a[title=\"Example/Tree 12\"] + ol > li:only-child > a[title=\"Example/Tree 121\"]:only-child",
					"div.srf-tree > ol > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ol > li:nth-child(3) > a[title=\"Example/Tree 13\"]:only-child",

					"div.srf-tree > ol > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ol > li:nth-child(1) > a[title=\"Example/Tree 21\"]:only-child",
					"div.srf-tree > ol > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ol > li:nth-child(2) > a[title=\"Example/Tree 22\"]:only-child",

					"div.srf-tree > ol > li:nth-child(3) > a[title=\"Example/Tree 3\"] + ol > li:nth-child(1) > a[title=\"Example/Tree 31\"]:only-child",
					"div.srf-tree > ol > li:nth-child(3) > a[title=\"Example/Tree 3\"] + ol > li:nth-child(2) > a[title=\"Example/Tree 32\"] + ol > li:only-child > a[title=\"Example/Tree 321\"]:only-child",
					"div.srf-tree > ol > li:nth-child(3) > a[title=\"Example/Tree 3\"] + ol > li:nth-child(3) > a[title=\"Example/Tree 33\"]:only-child",

					[ "div.srf-tree > ol > li", 3 ],
					[ "div.srf-tree > ol > li > ol > li", 8 ],
					[ "div.srf-tree > ol > li > ol > li > ol > li", 2 ]
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 01-06 (Multi-page result with root specified (oltree))",
			"subject": "Example/Tree 01-06",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ol > li:only-child > a[title=\"Example/Tree 2\"] + ol > li:nth-child(1) > a[title=\"Example/Tree 21\"]:only-child",
					"div.srf-tree > ol > li:only-child > a[title=\"Example/Tree 2\"] + ol > li:nth-child(2) > a[title=\"Example/Tree 22\"]:only-child",
					
					[ "div.srf-tree > ol > li", 1 ],
					[ "div.srf-tree > ol > li > ol > li", 2 ]
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": true
	}
}