summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/TestCases/tree-07.json
blob: a2b702c6c2f57283af390782f69328a22b2089cd (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
{
	"description": "Tree format: Simple one-page result",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has parent",
			"contents": "[[Has type::Page]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Part of",
			"contents": "[[Has type::Text]]"
		},
		{
			"namespace": "NS_TEMPLATE",
			"page": "Example/Tree format template",
			"contents": "FOO{{{1|}}}BAR{{{userparam|}}}BAZ"
		},
		{
			"page": "Example/Tree 1",
			"contents": "[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 11",
			"contents": "[[Part of::Tree test]][[Has parent::Example/Tree 1]]"
		},
		{
			"page": "Example/Tree 07-01",
			"contents": "{{#ask:[[Part of::Tree test]] |?Has parent |format=tree |parent=Has parent }}"
		},
		{
			"page": "Example/Tree 07-02",
			"contents": "{{#ask:[[Part of::Tree test]] |?Has parent |format=tree |parent=Has parent |link=all}}"
		},
		{
			"page": "Example/Tree 07-03",
			"contents": "{{#ask:[[Part of::Tree test]] |?Has parent |format=tree |parent=Has parent |link=subject}}"
		},
		{
			"page": "Example/Tree 07-04",
			"contents": "{{#ask:[[Part of::Tree test]] |?Has parent |format=tree |parent=Has parent |link=none}}"
		},
		{
			"page": "Example/Tree 07-05",
			"contents": "{{#ask:[[Part of::Tree test]] |?Has parent |format=tree |parent=Has parent |template=Example/Tree format template |userparam=someparam }}"
		},
		{
			"page": "Example/Tree 07-06",
			"contents": "{{#ask:[[Part of::Tree test]] |?Has parent |format=tree |parent=Has parent |template=Example/Tree format template |userparam=someparam |link=none}}"
		}
	],
	"tests": [
		{
			"type": "parser-html",
			"about": "Tree 07-01 (Default linking)",
			"subject": "Example/Tree 07-01",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ul > li > a[title=\"Example/Tree 1\"] + ul > li > a[title=\"Example/Tree 11\"] + a[title=\"Property:Has parent\"] + a[title=\"Example/Tree 1\"]"
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 07-02 (link=all)",
			"subject": "Example/Tree 07-02",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ul > li > a[title=\"Example/Tree 1\"] + ul > li > a[title=\"Example/Tree 11\"] + a[title=\"Property:Has parent\"] + a[title=\"Example/Tree 1\"]"
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 07-03 (link=subject)",
			"subject": "Example/Tree 07-03",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ul > li > a[title=\"Example/Tree 1\"] + ul > li > a[title=\"Example/Tree 11\"]:first-of-type + a[title=\"Property:Has parent\"]:last-of-type"

				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 07-04 (link=none)",
			"subject": "Example/Tree 07-04",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ul > li > ul:only-child > li > a[title=\"Property:Has parent\"]:only-child"
				]
			}
		},
		{
			"type": "parser",
			"about": "Tree 07-05-1 (template with userparam)",
			"subject": "Example/Tree 07-05",
			"assert-output": {
				"to-contain": [
					"BARsomeparamBAZ"
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 07-05-2 (template with userparam: assert intact default linking)",
			"subject": "Example/Tree 07-05",
			"assert-output": {
				"to-contain": [
					"div.srf-tree > ul > li > a[title=\"Example/Tree 1\"] + ul > li > a[title=\"Example/Tree 11\"]"
				]
			}
		},
		{
			"type": "parser",
			"about": "Tree 07-06 (template with userparam and link=none)",
			"subject": "Example/Tree 07-06",
			"assert-output": {
				"to-contain": [
					"FOOExample/Tree 1BARsomeparamBAZ",
					"FOOExample/Tree 11BARsomeparamBAZ"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}