summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0443.json
blob: b78978247df5796306edb97cf9c1dccab6f43fb7 (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
{
	"description": "Test conditions and strict constraint validations for uniqueness `_PVUC` on `_txt`/`_rec`/`_ref_rec` with unique field (#1463, #3547, `smwgDVFeatures`)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has uniqueness one",
			"contents": "[[Has type::Text]] [[Has uniqueness constraint::true]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has uniqueness two",
			"contents": "[[Has type::Text]] [[Has uniqueness constraint::true]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Unique field",
			"contents": "[[Has type::Text]] [[Has uniqueness constraint::true]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Another unique field",
			"contents": "[[Has type::Text]] [[Has uniqueness constraint::true]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Unique record",
			"contents": "[[Has type::Record]] [[Has fields::Unique field;Non unique field]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Unique reference",
			"contents": "[[Has type::Reference]] [[Has fields::Unique field;Another unique field;Non unique field]]"
		},
		{
			"page": "Example/P0443/1",
			"contents": "[[Has uniqueness one::Allowed one]] [[Has uniqueness one::Not permitted]] [[Has uniqueness two::Allowed two]] [[Has uniqueness two::Not permitted]]"
		},
		{
			"page": "Example/P0443/2",
			"contents": "[[Has uniqueness one::1111]] {{#ask: [[Has uniqueness one::1111]] |link=none |format=plainlist}}"
		},
		{
			"page": "Example/P0443/3",
			"contents": "[[Unique record::abc;123]]"
		},
		{
			"page": "Example/P0443/4",
			"contents": "[[Unique record::abc;123]] (fails on abc)"
		},
		{
			"page": "Example/P0443/5",
			"contents": "[[Unique reference::abc;def;123]] (fails on abc)"
		},
		{
			"page": "Example/P0443/6",
			"contents": "[[Unique reference::abcd;def;123]]"
		},
		{
			"page": "Example/P0443/7",
			"contents": "[[Unique reference::abcde;def;123]] (fails on def)"
		}
	],
	"tests": [
		{
			"type": "parser",
			"about": "#0 (verify uniqueness for only one assignment per property)",
			"subject": "Example/P0443/1",
			"store": {
				"clear-cache": true
			},
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 5,
					"propertyKeys": [
						"_MDAT",
						"_SKEY",
						"_ERRC",
						"Has uniqueness one",
						"Has uniqueness two"
					],
					"propertyValues": [
						"Allowed one",
						"Allowed two"
					]
				}
			}
		},
		{
			"type": "parser",
			"about": "#1 (verify declared unique value doesn't interfere with #ask within the same page)",
			"subject": "Example/P0443/2",
			"assert-output": {
				"to-contain": [
					"<p>1111 Example/P0443/2"
				]
			}
		},
		{
			"type": "parser",
			"about": "#2 (verify uniqueness of field in record )",
			"subject": "Example/P0443/3",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_MDAT",
						"_SKEY",
						"Unique record"
					],
					"propertyValues": [
						"abc; 123"
					]
				}
			}
		},
		{
			"type": "parser",
			"about": "#3 (verify uniqueness of field in record fails for same value as used in Example/P0443/3)",
			"subject": "Example/P0443/4",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_MDAT",
						"_SKEY",
						"_ERRC"
					]
				}
			}
		},
		{
			"type": "parser",
			"about": "#4 (verify uniqueness of field in reference fails for same value as used in Example/P0443/3)",
			"subject": "Example/P0443/5",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_MDAT",
						"_SKEY",
						"_ERRC"
					]
				}
			}
		},
		{
			"type": "parser",
			"about": "#5 (verify uniqueness for reference with uniqueness fields)",
			"subject": "Example/P0443/6",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_MDAT",
						"_SKEY",
						"Unique reference"
					],
					"propertyValues": [
						"abcd"
					]
				}
			}
		},
		{
			"type": "parser",
			"about": "#6 (verify uniqueness of field in reference fails for same value as used in Example/P0443/6)",
			"subject": "Example/P0443/7",
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"_MDAT",
						"_SKEY",
						"_ERRC"
					]
				}
			}
		}
	],
	"settings": {
		"smwgDVFeatures": [
			"SMW_DV_PVUC"
		],
		"wgContLang": "en",
		"wgLang": "en"
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}