summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/f-0204.json
blob: 6836cedd500a3ef6dc78ad5e53545b740859f340 (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
{
	"description": "Test `format=table` on `_qty` for different positional unit preference (#1329, en)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Currency",
			"contents": "[[Has type::Quantity]], [[Display units::€,£,¥]] [[Corresponds to::€ 1]] [[Corresponds to::1.06 US, US$, $]] [[Corresponds to::0.70 British Pound,GBP,£]] [[Corresponds to::¥,JPY,Japanese Yen 114.2121]]"
		},
		{
			"page": "Example/F0204/1",
			"contents": "[[Currency::12 €]] [[Currency::¥ 500]] [[Currency::2 £]]"
		},
		{
			"page": "Example/F0204/2",
			"contents": "[[Currency::€ 20]] [[Currency::2000 JPY]] [[Currency::0.5 GBP]]"
		},
		{
			"page": "Example/F0204/3",
			"contents": "{{#ask: [[Currency::+]] |?Currency |format=table |headers=plain }}"
		}
	],
	"tests": [
		{
			"type": "format",
			"about": "#0 output with different positional preference",
			"subject": "Example/F0204/3",
			"assert-output": {
				"to-contain": [
					"<span class=\"smwtext\">€&#160;12</span><span class=\"smwttcontent\">8.4&#160;£ <br />¥&#160;1,370.545 <br /></span></span>",
					"<span class=\"smwtext\">€&#160;4.378</span><span class=\"smwttcontent\">3.064&#160;£ <br />¥&#160;500 <br /></span></span>",
					"<span class=\"smwtext\">€&#160;2.857</span><span class=\"smwttcontent\">2&#160;£ <br />¥&#160;326.32 <br /></span></span>",
					"<span class=\"smwtext\">€&#160;20</span><span class=\"smwttcontent\">14&#160;£ <br />¥&#160;2,284.242 <br /></span></span>",
					"<span class=\"smwtext\">€&#160;17.511</span><span class=\"smwttcontent\">12.258&#160;£ <br />¥&#160;2,000 <br /></span></span>",
					"<span class=\"smwtext\">€&#160;0.714</span><span class=\"smwttcontent\">0.5&#160;£ <br />¥&#160;81.58 <br /></span></span>"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}