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

65 lines
2.1 KiB
JSON

{
"description": "Test in-text annotation on `_tem` with display unit preference (en)",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has temperature",
"contents": "[[Has type::Temperature]] [[Display unit::Celsius]]"
},
{
"page": "Example/P0415/1",
"contents": "[[Has temperature:: 32 °F]] [[Has temperature::100 °C]]"
},
{
"page": "Example/P0415/1a",
"contents": "{{#ask: [[Example/P0415/1]] |?Has temperature|+order=asc |?Has temperature#-=-|+order=asc |?Has temperature#-u=-u|+order=asc |?Has temperature#-n=-n|+order=asc |?Has temperature#°R=°R|+order=asc |format=table }}"
}
],
"tests": [
{
"type": "parser",
"about": "#0",
"subject": "Example/P0415/1",
"assert-store": {
"semantic-data": {
"strictPropertyValueMatch": false,
"propertyCount": 3,
"propertyKeys": [
"_SKEY",
"_MDAT",
"Has_temperature"
],
"propertyValues": [
273.15,
373.15
]
}
}
},
{
"type": "parser",
"about": "#2",
"subject": "Example/P0415/1a",
"assert-output": {
"to-contain": [
"<span class=\"smwtext\">0&#160;°C</span><span class=\"smwttcontent\">273.15&#160;K &lt;br /&gt;32&#160;°F &lt;br /&gt;491.67&#160;°R &lt;br /&gt;</span></span>",
"<span class=\"smwtext\">100&#160;°C</span><span class=\"smwttcontent\">373.15&#160;K &lt;br /&gt;212&#160;°F &lt;br /&gt;671.67&#160;°R &lt;br /&gt;</span></span>",
"<td class=\"- smwtype_tem\" data-sort-value=\"273.15\">0 °C<br />100 °C</td>",
"<td class=\"-u smwtype_tem\" data-sort-value=\"273.15\">°C<br />°C</td>",
"<td class=\"-n smwtype_tem\" data-sort-value=\"273.15\">0<br />100</td>",
"<span class=\"smwtext\">491.67&#160;°R</span><span class=\"smwttcontent\">0&#160;°C &lt;br /&gt;273.15&#160;K &lt;br /&gt;32&#160;°F &lt;br /&gt;</span></span>",
"<span class=\"smwtext\">671.67&#160;°R</span><span class=\"smwttcontent\">100&#160;°C &lt;br /&gt;373.15&#160;K &lt;br /&gt;212&#160;°F &lt;br /&gt;</span></span>"
]
}
}
],
"settings": {
"wgContLang": "en",
"wgLang": "en"
},
"meta": {
"version": "2",
"is-incomplete": false,
"debug": false
}
}