summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-1108.json
blob: 467c6d6e4cb9b557d0fdcf4b013b5018ddc2a241 (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
{
	"description": "Test conditions and constraint validations for allowed values `_LIST` and uniqueness `_PVUC` (#1207, `wgContLang=en`, `wgLang=en`)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has text",
			"contents": "[[Has type::Text]] [[Allows value::open]], [[Allows value::closed]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has uniqueness",
			"contents": "[[Has type::Text]] [[Has uniqueness constraint::true]]"
		},
		{
			"page": "Example/Q1108/1",
			"contents": "[[Category:Q1108]][[Has text::open]]"
		},
		{
			"page": "Example/Q1108/2",
			"contents": "[[Category:Q1108]][[Has text::close]]"
		},
		{
			"page": "Example/Q1108/3",
			"contents": "[[Category:Q1108]][[Has text::invalid]]"
		},
		{
			"page": "Example/Q1108/4",
			"contents": "[[Category:Q1108]] [[Has uniqueness::Foo]]"
		},
		{
			"page": "Example/Q1108/5",
			"contents": "[[Category:Q1108]] [[Has uniqueness::Foo]]"
		},
		{
			"page": "Example/Q1108/Q1",
			"contents": "{{#ask: [[Category:Q1108]] [[Has uniqueness::Foo]] |link=none}}"
		}
	],
	"tests": [
		{
			"type": "parser",
			"about": "#3 embedded query with uniqueness condition works without raising an issue due to different context page",
			"subject": "Example/Q1108/Q1",
			"assert-output": {
				"to-contain": [
					"Example/Q1108/4"
				]
			}
		},
		{
			"type": "query",
			"about": "#0 matches one with open",
			"condition": "[[Category:Q1108]][[Has text::open]]",
			"printouts": [],
			"parameters": {
				"limit": 10
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Example/Q1108/1#0##"
				]
			}
		},
		{
			"type": "query",
			"about": "#1 matches none",
			"condition": "[[Category:Q1108]][[Has text::invalid]]",
			"printouts": [],
			"parameters": {
				"limit": 10
			},
			"assert-queryresult": {
				"count": 0,
				"results": []
			}
		},
		{
			"type": "query",
			"about": "#2",
			"condition": "[[Category:Q1108]] [[Has uniqueness::Foo]]",
			"printouts": [],
			"parameters": {
				"limit": 10
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Example/Q1108/4#0##"
				]
			}
		}
	],
	"settings": {
		"smwgDVFeatures": [
			"SMW_DV_PVUC"
		],
		"wgContLang": "en",
		"wgLang": "en"
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}