gplx/mediawiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0431.json

104 lines
2.4 KiB
JSON

{
"description": "Test in-text annotation `_rec` and `|+index` (`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": "SMW_NS_PROPERTY",
"page": "Has record",
"contents": "[[Has type::Record]] [[Has fields::Has text;Has number]] [[Has property description::Test@en]]"
},
{
"page": "Example/P0431/1",
"contents": "[[Has record::Foo;123]]"
},
{
"page": "Example/P0431/2",
"contents": "[[Has record::#abc;123]]"
},
{
"page": "Example/P0431/Q1.1",
"contents": "{{#ask: [[Has record::+]] |?Has record|+index=Has text}}"
},
{
"page": "Example/P0431/Q1.2",
"contents": "{{#ask: [[Has record::+]] |?Has record|+index=Has number|?Has record|+index=Has text}}"
},
{
"page": "Example/P0431/Q2.1",
"contents": "{{#ask: [[Has property description::Test@en]] |?Has property description|+index=Language code}}"
}
],
"tests": [
{
"type": "parser",
"about": "#0",
"subject": "Example/P0431/Q1.1",
"assert-output": {
"to-contain": [
"Example/P0431/1",
"<td class=\"Has-record smwtype_txt\">Foo</td>"
],
"not-contain": [
"<td class=\"Has-record smwtype_num\" data-sort-value=\"123\">123</td>"
]
}
},
{
"type": "parser",
"about": "#1",
"subject": "Example/P0431/Q1.2",
"assert-output": {
"to-contain": [
"Example/P0431/1",
"<td class=\"Has-record smwtype_txt\">Foo</td>",
"<td class=\"Has-record smwtype_num\" data-sort-value=\"123\">123</td>"
]
}
},
{
"type": "parser",
"about": "#2",
"subject": "Example/P0431/Q2.1",
"assert-output": {
"to-contain": [
"Property:Has record",
"<td class=\"Property-description smwtype&#95;_lcode\">en</td>"
]
}
},
{
"type": "parser",
"about": "#3 (no ul/ol list output for #... annotated value)",
"subject": "Example/P0431/2",
"assert-output": {
"to-contain": [
"&#x23;abc (123)"
],
"not-contain": [
"<ol><li>abc</li></ol>"
]
}
}
],
"settings": {
"wgContLang": "en",
"wgLang": "en"
},
"meta": {
"skip-on": {
"mysql": "Failed assertions, check implementation of MediaWikiIntegrationTestCase."
},
"version": "2",
"is-incomplete": false,
"debug": false
}
}