gplx/mediawiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/special-ask-0014.json

66 lines
1.3 KiB
JSON

{
"description": "Test `format=json` output via `Special:Ask` for `_ref_rec`/`_qty` type (#3517)",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "Ref prop",
"contents": "[[Has type::Reference]] [[Has fields::Field prop;other prop]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Field prop",
"contents": "[[Has type::Quantity]] [[Corresponds to::1 km]]"
},
{
"namespace": "NS_MAIN",
"page": "SA0014/1",
"contents": "[[Ref prop::123;SA0014/2]] [[Category:SA0014]]"
}
],
"tests": [
{
"type": "special",
"about": "#0",
"special-page": {
"page": "Ask",
"request-parameters": {
"p": {
"link": "none",
"limit": "10",
"offset": "0",
"mainlabel": "",
"prettyprint": false,
"unescape": true,
"format": "json"
},
"q": "[[Category:SA0014]]",
"po": "?Ref prop.Field prop"
}
},
"assert-output": {
"to-contain": [
"\"chain\":\"Ref prop.Field prop\"",
"{\"Field prop\":[{\"value\":123,\"unit\":\"km\"}]}"
]
}
}
],
"settings": {
"wgContLang": "en",
"wgLang": "en",
"wgLanguageCode": "en",
"smwgPageSpecialProperties": [
"_MDAT"
],
"smwgNamespacesWithSemanticLinks": {
"NS_MAIN": true,
"SMW_NS_PROPERTY": true
}
},
"meta": {
"version": "2",
"is-incomplete": false,
"debug": false
}
}