summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/f-0103.json
blob: 53964aad8adbf721e70774604080e74d35e4bb07 (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
{
	"description": "Test `format=template` with self reference (#988, guard against template self-reference in ask/show query)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has blob property",
			"contents": "[[Has type::Text]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has page property",
			"contents": "[[Has type::Page]]"
		},
		{
			"page": "Page with annotation for template usage",
			"contents": "[[Has blob property::Template one]] [[Has page property::Template two]]"
		},
		{
			"namespace": "NS_TEMPLATE",
			"page": "TemplateWithReferenceToItself",
			"contents": "<includeonly>{{#ask: [[Has page property::Template two]] OR [[Has page property::Template three]]|format=template|template=TemplateWithReferenceToItself}}</includeonly>"
		},
		{
			"page": "PageContainsAskWithTemplateUsage",
			"contents": "{{#ask: [[Has blob property::Template one]]|format=template|template=TemplateWithReferenceToItself|import-annotation=true}}"
		},
		{
			"page": "PageContainsTemplateTransclusion",
			"contents": "[[Has page property::Template three]] {{TemplateWithReferenceToItself}}"
		}
	],
	"tests": [
		{
			"type": "query",
			"about": "#0 query profile (use invert query)",
			"condition": "[[-Has query::PageContainsAskWithTemplateUsage]]",
			"printouts": [
				"Query size",
				"Query string",
				"Query depth"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"results": [
					"PageContainsAskWithTemplateUsage#0##_QUERY243ffe4b18342e8ae68152cedc5b1966",
					"PageContainsAskWithTemplateUsage#0##_QUERYe295f9adeb904a1cbab1e30eb56d79ba"
				],
				"count": "2",
				"datavalues": [
					{
						"property": "Query size",
						"value": "1"
					},
					{
						"property": "Query depth",
						"value": "1"
					},
					{
						"property": "Query string",
						"value": "[[Has blob property::Template one]]"
					},
					{
						"property": "Query size",
						"value": "4"
					},
					{
						"property": "Query depth",
						"value": "1"
					},
					{
						"property": "Query string",
						"value": " <q> <q>[[Has page property::Template two]]</q>  OR  <q>[[Has page property::Template three]]</q> </q> "
					}
				]
			}
		},
		{
			"type": "query",
			"about": "#1 query profile on page/template transcluded page (use invert query)",
			"condition": "[[-Has query::PageContainsTemplateTransclusion]]",
			"printouts": [
				"Query size",
				"Query string",
				"Query depth"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"results": [
					"PageContainsTemplateTransclusion#0##_QUERY243ffe4b18342e8ae68152cedc5b1966"
				],
				"count": "1",
				"datavalues": [
					{
						"property": "Query size",
						"value": "4"
					},
					{
						"property": "Query depth",
						"value": "1"
					},
					{
						"property": "Query string",
						"value": " <q> <q>[[Has page property::Template two]]</q>  OR  <q>[[Has page property::Template three]]</q> </q> "
					}
				]
			}
		}
	],
	"settings": {
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}