summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/s-0029.json
blob: 41525ec33e1693909f00f84e7e5ebf46c1ea4141 (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
{
	"description": "Test `Special:Ask` output on `mainlabel=.../?#...`, `format=table`",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has page",
			"contents": "[[Has type::Page]]"
		},
		{
			"page": "Example/S0029/1",
			"contents": "[[Has page::123]] [[Category:S0029]]"
		}
	],
	"tests": [
		{
			"type": "special",
			"about": "#0 (?#, empty mainlabel)",
			"special-page": {
				"page": "Ask",
				"query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23/mainlabel%3D/offset%3D0/format%3Dtable",
				"request-parameters": []
			},
			"assert-output": {
				"to-contain": [
					"<table class=\"sortable wikitable smwtable\">",
					"<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
					"<td class=\"smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
				]
			}
		},
		{
			"type": "special",
			"about": "#0.1 (?, empty mainlabel)",
			"special-page": {
				"page": "Ask",
				"query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F/mainlabel%3D/offset%3D0/format%3Dtable",
				"request-parameters": []
			},
			"assert-output": {
				"to-contain": [
					"<table class=\"sortable wikitable smwtable\">",
					"<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
					"<td class=\"smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
				]
			}
		},
		{
			"type": "special",
			"about": "#1 (?#, mainlabel=-, output the same as in #0)",
			"special-page": {
				"page": "Ask",
				"query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23/mainlabel%3D-2D/offset%3D0/format%3Dtable",
				"request-parameters": []
			},
			"assert-output": {
				"to-contain": [
					"<table class=\"sortable wikitable smwtable\">",
					"<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
					"<td class=\"smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
				]
			}
		},
		{
			"type": "special",
			"about": "#2 (?#, mainlabel=FOO, ?# takes precedence over mainlabel, same output as in #0)",
			"special-page": {
				"page": "Ask",
				"query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23/mainlabel%3DFOO/offset%3D0/format%3Dtable",
				"request-parameters": []
			},
			"assert-output": {
				"to-contain": [
					"<table class=\"sortable wikitable smwtable\">",
					"<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
					"<td class=\"smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
				]
			}
		},
		{
			"type": "special",
			"about": "#3 (?#- forces plain output, empty mainlabel)",
			"special-page": {
				"page": "Ask",
				"query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23-2D/mainlabel%3D/offset%3D0/format%3Dtable",
				"request-parameters": []
			},
			"assert-output": {
				"to-contain": [
					"<table class=\"sortable wikitable smwtable\">",
					"<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
					"<td class=\"smwtype_wpg\">Example/S0029/1</td>"
				]
			}
		},
		{
			"type": "special",
			"about": "#4 (?#=Foo, empty mainlabel)",
			"special-page": {
				"page": "Ask",
				"query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23%3DFoo/mainlabel%3D/offset%3D0/format%3Dtable",
				"request-parameters": []
			},
			"assert-output": {
				"to-contain": [
					"<table class=\"sortable wikitable smwtable\">",
					"<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th class=\"Foo\">Foo</th>",
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
					"<td class=\"Foo smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
				]
			}
		},
		{
			"type": "special",
			"about": "#4.1 (?=Foo, empty mainlabel)",
			"special-page": {
				"page": "Ask",
				"query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F%3DFoo/mainlabel%3D/offset%3D0/format%3Dtable",
				"request-parameters": []
			},
			"assert-output": {
				"to-contain": [
					"<table class=\"sortable wikitable smwtable\">",
					"<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th class=\"Foo\">Foo</th>",
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
					"<td class=\"Foo smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
				]
			}
		},
		{
			"type": "special",
			"about": "#5 (?#=Foo#- forces plain output, empty mainlabel)",
			"special-page": {
				"page": "Ask",
				"query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23%3DFoo-23-2D/mainlabel%3D/offset%3D0/format%3Dtable",
				"request-parameters": []
			},
			"assert-output": {
				"to-contain": [
					"<table class=\"sortable wikitable smwtable\">",
					"<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th class=\"Foo\">Foo</th>",
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
					"<td class=\"Foo smwtype_wpg\">Example/S0029/1</td>"
				]
			}
		},
		{
			"type": "special",
			"about": "#6 (?#=Foo#- forces plain output, mainlabel=-, same output as in #5)",
			"special-page": {
				"page": "Ask",
				"query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23%3DFoo-23-2D/mainlabel%3D-2D/offset%3D0/format%3Dtable",
				"request-parameters": []
			},
			"assert-output": {
				"to-contain": [
					"<table class=\"sortable wikitable smwtable\">",
					"<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th class=\"Foo\">Foo</th>",
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
					"<td class=\"Foo smwtype_wpg\">Example/S0029/1</td>"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLanguageCode": "en",
		"smwgPageSpecialProperties": [
			"_MDAT"
		],
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}