summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0502.json
blob: aecac40f47b6e86b763e22e9bf0b867976211ba3 (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
{
	"description": "Test in-text annotation allows value list (#2295, `wgContLang=en`, `wgLang=en`)",
	"setup": [
		{
			"namespace": "NS_MEDIAWIKI",
			"page": "Smw allows list Publication categories",
			"contents": {
				"import-from": "/../Fixtures/p-0502.txt"
			}
		},
		{
			"namespace": "NS_MEDIAWIKI",
			"page": "Smw allows list error",
			"contents": {
				"import-from": "/../Fixtures/p-0502-error.txt"
			}
		},
		{
			"namespace": "NS_MEDIAWIKI",
			"page": "Smw allows list license",
			"contents": "* BSD-2-Clause|2-clause BSD License (BSD-2-Clause)\n* Zlib|zlib/libpng license (Zlib)"
		},
		{
			"namespace": "NS_MEDIAWIKI",
			"page": "Smw allows list other license.json",
			"contents": {
				"import-from": "/../Fixtures/p-0502-other-license.json"
			}
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has list",
			"contents": "[[Has type::Text]] [[Allows value list::Publication categories]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has combined list",
			"contents": "[[Has type::Text]] [[Allows value list::Publication categories]] [[Allows value::abc]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has combined error list",
			"contents": "[[Has type::Text]] [[Allows value list::error]] [[Allows value::Foo]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has license",
			"contents": "[[Has type::Text]] [[Allows value list::license]] [[Allows value list::other license.json]]"
		},
		{
			"page": "Example/P0502/1",
			"contents": "[[Has list::abc]]"
		},
		{
			"page": "Example/P0502/2",
			"contents": "[[Has list::Document]] [[Has list::Manuscript]]"
		},
		{
			"page": "Example/P0502/3",
			"contents": "[[Has combined list::abc]] [[Has combined list::Manuscript]]"
		},
		{
			"page": "Example/P0502/4",
			"contents": "[[Has combined error list::Foobar]]"
		},
		{
			"page": "Example/P0502/5",
			"contents": "[[Has license::Zlib]]"
		},
		{
			"page": "Example/P0502/6",
			"contents": "[[Has license::PD]]"
		}
	],
	"tests": [
		{
			"type": "parser",
			"about": "#0 invalid assignment",
			"subject": "Example/P0502/1",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_SKEY",
						"_MDAT",
						"_ERRC"
					],
					"propertyValues": []
				}
			}
		},
		{
			"type": "parser",
			"about": "#1 valid assignment",
			"subject": "Example/P0502/2",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_SKEY",
						"_MDAT",
						"Has list"
					],
					"propertyValues": [
						"Document",
						"Manuscript"
					]
				}
			}
		},
		{
			"type": "parser",
			"about": "#2 valid assignment",
			"subject": "Example/P0502/3",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_SKEY",
						"_MDAT",
						"Has combined list"
					],
					"propertyValues": [
						"abc",
						"Manuscript"
					]
				}
			}
		},
		{
			"type": "parser",
			"about": "#3 error output",
			"subject": "Example/P0502/4",
			"assert-output": {
				"to-contain": [
					"\"Foobar\" is not in the list (Foo, Bar)"
				]
			}
		},
		{
			"type": "parser",
			"about": "#4 assignment on key (* key|value)",
			"subject": "Example/P0502/5",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_SKEY",
						"_MDAT",
						"Has license"
					],
					"propertyValues": [
						"Zlib"
					]
				}
			}
		},
		{
			"type": "parser",
			"about": "#5 assignment from JSON",
			"subject": "Example/P0502/6",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_SKEY",
						"_MDAT",
						"Has license"
					],
					"propertyValues": [
						"PD"
					]
				}
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgPageSpecialProperties": [
			"_MDAT"
		]
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}