summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticResultFormats/tests/phpunit/Integration/JSONScript/TestCases/tree-06.json
blob: c6bc3184373fa3dc3bdf76ed2ae5ca771a4cb06b (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
{
	"description": "Tree format: Insert elements with multiple parents multiple times",
	"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"
		},
		{
			"page": "Example/Tree 1",
			"contents": "<!-- No parent -->[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 2",
			"contents": "<!-- No parent -->[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 3",
			"contents": "<!-- No parent -->[[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 11",
			"contents": "[[Has parent::Example/Tree 1]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 12",
			"contents": "[[Has parent::Example/Tree 1]][[Has parent::Example/Tree 2]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 13",
			"contents": "[[Has parent::Example/Tree 1]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 121",
			"contents": "[[Has parent::Example/Tree 12]][[Part of::Tree test]]"
		},
		{
			"page": "Example/Tree 06-01",
			"contents": "<div>{{#ask:[[Part of::Tree test]] |format=tree |parent=Has parent }}</div>"
		},
		{
			"page": "Example/Tree 06-02",
			"contents": "<div>{{#ask:[[Part of::Tree test]] |format=tree |parent=Has parent |template=Example/Tree format template }}</div>"
		}
	],
	"tests": [
		{
			"type": "parser-html",
			"about": "Tree 06-01 (Insert elements with multiple parents multiple times)",
			"subject": "Example/Tree 06-01",
			"assert-output": {
				"to-contain": [
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 11\"]:only-child",
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 13\"]:only-child",

					"div > ul > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ul > li:only-child > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",

					"div > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"]:only-child",

					[ "div > ul > li", 3 ],
					[ "div > ul > li > ul > li", 4 ],
					[ "div > ul > li > ul > li > ul > li", 2 ]
				]
			}
		},
		{
			"type": "parser-html",
			"about": "Tree 06-02-1 (Insert elements with multiple parents multiple times (with template)) - structure",
			"subject": "Example/Tree 06-02",
			"assert-output": {
				"to-contain": [
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(1) > a[title=\"Example/Tree 11\"]:only-child",
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(2) > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",
					"div > ul > li:nth-child(1) > a[title=\"Example/Tree 1\"] + ul > li:nth-child(3) > a[title=\"Example/Tree 13\"]:only-child",

					"div > ul > li:nth-child(2) > a[title=\"Example/Tree 2\"] + ul > li:only-child > a[title=\"Example/Tree 12\"] + ul > li:only-child > a[title=\"Example/Tree 121\"]:only-child",

					"div > ul > li:nth-child(3) > a[title=\"Example/Tree 3\"]:only-child",

					[ "div > ul > li", 3 ],
					[ "div > ul > li > ul > li", 4 ],
					[ "div > ul > li > ul > li > ul > li", 2 ]
				]
			}
		},
		{
			"type": "parser",
			"about": "Tree 06-02-2 (Insert elements with multiple parents multiple times (with template)) - content",
			"subject": "Example/Tree 06-02",
			"assert-output": {
				"to-contain": [
					"FOO.*Example/Tree 1.*BAR",
					"FOO.*Example/Tree 11.*BAR",
					"FOO.*Example/Tree 12.*BAR",
					"FOO.*Example/Tree 121.*BAR",
					"FOO.*Example/Tree 13.*BAR",
					"FOO.*Example/Tree 2.*BAR",
					"FOO.*Example/Tree 3.*BAR"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": true
	}
}