summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0705.json
blob: 6d678b64e138416ed9147c40ab9a038c3219a8d5 (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
{
	"description": "Test `#ask`/ NS_FILE option (`wgContLang=en`, `wgLang=en`, `wgEnableUploads`, `wgFileExtensions`, 'wgDefaultUserOptions')",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has text",
			"contents": "[[Has type::Text]]"
		},
		{
			"namespace": "NS_FILE",
			"page": "P0705.png",
			"contents": {
				"upload": {
					"file" : "/../Fixtures/image-upload-480.png",
					"text" : "[[Has file::{{FULLPAGENAME}}]] [[Has caption::123]] {{#subobject:Test|Has text=Foo}}"
				}
			}
		},
		{
			"page": "Example/P0705/Q.1",
			"contents": "{{#ask: [[Has file::+]] |?Has file |format=table |limit=1 }}"
		},
		{
			"page": "Example/P0705/Q.2",
			"contents": "{{#ask: [[Has file::+]] |?Has file#120px;thumb;<b>{{#show: File:P0705.png |?Has caption |link=none}}</b>[[Extra]] |format=table |limit=1 }}"
		},
		{
			"page": "Example/P0705/Q.3",
			"contents": "{{#ask: [[File:+]] }}"
		}
	],
	"tests": [
		{
			"type": "parser",
			"about": "#0",
			"subject": "Example/P0705/Q.1",
			"assert-output": {
				"to-contain": [
					"class=\"image\"><img alt=\"P0705.png\"",
					"300px-P0705.png\" width=\"300\" height=\"300\" style=\"vertical-align: text-top\" class=\"thumbborder\""
				],
				"not-contain": [
					"P0705.png\" width=\"480\" height=\"480\""
				]
			}
		},
		{
			"type": "parser",
			"about": "#1 with options",
			"subject": "Example/P0705/Q.2",
			"assert-output": {
				"to-contain": [
					"300px-P0705.png\" width=\"300\" height=\"300\" style=\"vertical-align: text-top\" class=\"thumbborder\"",
					"class=\"image\"><img alt=\"P0705.png\"",
					"120px-P0705.png\" width=\"120\" height=\"120\" class=\"thumbimage\"",
					"<b>123</b>",
					"class=\"thumb tright\"",
					"<div class=\"thumbcaption\"><div class=\"magnify\">",
					"Extra"
				]
			}
		},
		{
			"type": "parser",
			"about": "#2 (subobject is displayed as normal link and not with an image reference)",
			"subject": "Example/P0705/Q.3",
			"assert-output": {
				"to-contain": [
					"<span class=\"smw-subobject-entity\"><a href=.*P0705.png#Test\" title=.*P0705.png\">P0705.png#Test</a></span>",
					"<a href=.*P0705.png\" class=\"image\"><img alt=\"P0705.png\" .*class=\"thumbborder\" .*</a>"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"wgEnableUploads": true,
		"wgFileExtensions": [
			"png"
		],
		"wgDefaultUserOptions": {
			"thumbsize": 5
		},
		"smwgPageSpecialProperties": [
			"_MDAT"
		],
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"NS_FILE": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}