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

249 lines
5.2 KiB
JSON

{
"description": "Test `format=csv` output via `Special:Ask` (`wgContLang=en`, `wgLang=en`)",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has text",
"contents": "[[Has type::Text]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has number",
"contents": "[[Has type::Number]]"
},
{
"namespace": "NS_MAIN",
"page": "Example/SA0009/1",
"contents": "[[Has text::Some example]] [[Category:SA0009]]"
},
{
"namespace": "NS_MAIN",
"page": "Example/SA0009/2",
"contents": "[[Has number::123]] [[Has number::345]] [[Category:SA0009]]"
},
{
"namespace": "NS_MAIN",
"page": "Example/SA0009/3",
"contents": "[[Has text::ABC]] [[Has number::123]] [[Category:SA0009]]"
},
{
"namespace": "NS_MAIN",
"page": "Example/SA0009/4",
"contents": "[[Has text::DEF]] [[Has number::123]] [[Category:SA0009]]"
}
],
"tests": [
{
"type": "special",
"about": "#0 with header",
"special-page": {
"page": "Ask",
"request-parameters": {
"p": {
"link": "none",
"limit": "10",
"offset": "0",
"mainlabel": "",
"format": "csv"
},
"q": "[[Category:SA0009]]",
"po": "?Has text|+order=asc|?Has number|+order=asc"
}
},
"assert-output": {
"to-contain": {
"contents-file" : "/../Fixtures/res.special-ask-0009.0.csv"
}
}
},
{
"type": "special",
"about": "#1 without header",
"special-page": {
"page": "Ask",
"request-parameters": {
"p": {
"link": "none",
"limit": "10",
"offset": "0",
"mainlabel": "",
"headers": "hide",
"format": "csv"
},
"q": "[[Category:SA0009]]",
"po": "?Has text|+order=asc|?Has number|+order=asc"
}
},
"assert-output": {
"to-contain": {
"contents-file" : "/../Fixtures/res.special-ask-0009.1.csv"
}
}
},
{
"type": "special",
"about": "#2 mainlabel",
"special-page": {
"page": "Ask",
"request-parameters": {
"p": {
"link": "none",
"limit": "10",
"offset": "0",
"mainlabel": "-",
"format": "csv"
},
"q": "[[Category:SA0009]]",
"po": "?Has number|+order=asc|?Has text|+order=asc"
}
},
"assert-output": {
"to-contain": {
"contents-file" : "/../Fixtures/res.special-ask-0009.2.csv"
}
}
},
{
"type": "special",
"about": "#3 merge rows with identical first column identifier",
"special-page": {
"page": "Ask",
"request-parameters": {
"p": {
"link": "none",
"limit": "10",
"offset": "0",
"mainlabel": "-",
"format": "csv",
"merge": true
},
"q": "[[Category:SA0009]]",
"po": "?Has number|+order=asc|?Has text|+order=asc"
}
},
"assert-output": {
"to-contain": {
"contents-file" : "/../Fixtures/res.special-ask-0009.3.csv"
}
}
},
{
"type": "special",
"about": "#4 valuesep, headers=hide",
"special-page": {
"page": "Ask",
"request-parameters": {
"p": {
"link": "none",
"limit": "10",
"offset": "0",
"mainlabel": "",
"headers": "hide",
"valuesep": ";",
"format": "csv"
},
"q": "[[Category:SA0009]]",
"po": "?Has text|+order=asc|?Has number|+order=asc"
}
},
"assert-output": {
"to-contain": {
"contents-file" : "/../Fixtures/res.special-ask-0009.4.csv"
}
}
},
{
"type": "special",
"about": "#5 sep, valuesep",
"special-page": {
"page": "Ask",
"request-parameters": {
"p": {
"link": "none",
"limit": "10",
"offset": "0",
"format": "csv",
"sep": "|",
"valuesep": "+"
},
"q": "[[Category:SA0009]]",
"po": "?Has number|+order=asc|?Has text|+order=asc"
}
},
"assert-output": {
"to-contain": {
"contents-file" : "/../Fixtures/res.special-ask-0009.5.csv"
}
}
},
{
"type": "special",
"about": "#6 merge rows, valuesep",
"special-page": {
"page": "Ask",
"request-parameters": {
"p": {
"link": "none",
"limit": "10",
"offset": "0",
"mainlabel": "-",
"format": "csv",
"valuesep": ";",
"merge": true
},
"q": "[[Category:SA0009]]",
"po": "?Has number|+order=asc|?Has text|+order=asc"
}
},
"assert-output": {
"to-contain": {
"contents-file" : "/../Fixtures/res.special-ask-0009.6.csv"
}
}
},
{
"type": "special",
"about": "#7 merge rows, valuesep, sep",
"special-page": {
"page": "Ask",
"request-parameters": {
"p": {
"link": "none",
"limit": "10",
"offset": "0",
"mainlabel": "-",
"format": "csv",
"sep": "|",
"valuesep": ";",
"merge": true
},
"q": "[[Category:SA0009]]",
"po": "?Has number|+order=asc|?Has text|+order=asc"
}
},
"assert-output": {
"to-contain": {
"contents-file" : "/../Fixtures/res.special-ask-0009.7.csv"
}
}
}
],
"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
}
}