summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/f-0308.json
blob: 7b259e2274a16c831b40533f19fb0e4bc0f1e246 (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
{
	"description": "Test `format=table` with DEFAULTSORT and subject,property sorting",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Is performer",
			"contents": "[[Has type::Page]]"
		},
		{
			"page": "F0308/A",
			"contents": "[[Category:F0308]] {{DEFAULTSORT:F0308/A}} [[Is performer::August]]"
		},
		{
			"page": "F0308/AB",
			"contents": "[[Category:F0308]] {{DEFAULTSORT:F0308/A}} [[Is performer::September]]"
		},
		{
			"page": "F0308/Q.1",
			"contents": "{{#ask: [[Category:F0308]] |sort=,Is performer |order=asc,asc |format=table}}"
		},
		{
			"page": "F0308/Q.2",
			"contents": "{{#ask: [[Category:F0308]] |sort=,Is performer |order=asc,desc |format=table}}"
		},
		{
			"page": "F0308/Q.3",
			"contents": "{{#ask: [[Category:F0308]] |sort=,Is performer |order=desc,asc |format=table}}"
		},
		{
			"page": "F0308/Q.4",
			"contents": "{{#ask: [[Category:F0308]] |sort=,Is performer |order=desc,desc |format=table}}"
		}
	],
	"tests": [
		{
			"type": "format",
			"about": "#0 ( ,Is performer | asc,asc)",
			"subject": "F0308/Q.1",
			"assert-output": {
				"to-contain": [
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\"><a href=.* title=\"F0308/A\">F0308/A</a></td></tr>",
					"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\"><a href=.* title=\"F0308/AB\">F0308/AB</a></td></tr>"
				]
			}
		},
		{
			"type": "format",
			"about": "#1 ( ,Is performer | asc,desc)",
			"subject": "F0308/Q.2",
			"assert-output": {
				"to-contain": [
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\"><a href=.* title=\"F0308/AB\">F0308/AB</a></td></tr>",
					"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\"><a href=.* title=\"F0308/A\">F0308/A</a></td></tr>"
				]
			}
		},
		{
			"type": "format",
			"about": "#2 ( ,Is performer | desc,asc)",
			"subject": "F0308/Q.3",
			"assert-output": {
				"to-contain": [
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\"><a href=.* title=\"F0308/A\">F0308/A</a></td></tr>",
					"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\"><a href=.* title=\"F0308/AB\">F0308/AB</a></td></tr>"
				]
			}
		},
		{
			"type": "format",
			"about": "#3 ( ,Is performer | desc,desc)",
			"subject": "F0308/Q.4",
			"assert-output": {
				"to-contain": [
					"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\"><a href=.* title=\"F0308/AB\">F0308/AB</a></td></tr>",
					"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\"><a href=.* title=\"F0308/A\">F0308/A</a></td></tr>"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}