summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/f-0205.json
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/f-0205.json')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/f-0205.json93
1 files changed, 93 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/f-0205.json b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/f-0205.json
new file mode 100644
index 00000000..e53123c1
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/f-0205.json
@@ -0,0 +1,93 @@
+{
+ "description": "Test `format=table` on `|+align=`/`|+limit`/`|+order`/`|+width=` extra printout parameters (T18571, en)",
+ "setup": [
+ {
+ "namespace": "SMW_NS_PROPERTY",
+ "page": "Has number",
+ "contents": "[[Has type::Number]]"
+ },
+ {
+ "page": "Example/F0205/1/1",
+ "contents": "[[Has number::1]] [[Has number::42]] [[Has number::.02]]"
+ },
+ {
+ "page": "Example/F0205/1/2",
+ "contents": "[[Has number::21]] [[Has number::1001]] [[Has number::2.02]]"
+ },
+ {
+ "page": "Example/F0205/1a",
+ "contents": "{{#ask: [[~Example/F0205/1/*]] |?Has number |+align=right |+limit=2 |+order=asc |format=table |headers=plain }}"
+ },
+ {
+ "page": "Example/F0205/1b",
+ "contents": "{{#ask: [[~Example/F0205/1/*]] |?Has number |+align=left |+limit=2 |+order=desc |format=table |headers=plain }}"
+ },
+ {
+ "page": "Example/F0205/Q.2",
+ "contents": "{{#ask: [[~Example/F0205/1/*]] |?Has number |+width=50% |+limit=2 |+order=desc |format=table |headers=plain }}"
+ },
+ {
+ "page": "Example/F0205/Q.3",
+ "contents": "{{#ask: [[~Example/F0205/1/*]] |?Has number |+width=50% |+align=center |+limit=2 |+order=desc |format=table |headers=plain }}"
+ }
+ ],
+ "tests": [
+ {
+ "type": "format",
+ "about": "#0",
+ "subject": "Example/F0205/1a",
+ "assert-output": {
+ "to-contain": [
+ "class=\"Has-number smwtype_num\" data-sort-value=\"0.02\" style=\"text-align:right;\">0.02<br />1",
+ "class=\"Has-number smwtype_num\" data-sort-value=\"2.02\" style=\"text-align:right;\">2.02<br />21"
+ ]
+ }
+ },
+ {
+ "type": "format",
+ "about": "#1 (align, left)",
+ "subject": "Example/F0205/1b",
+ "assert-output": {
+ "to-contain": [
+ "class=\"Has-number smwtype_num\" data-sort-value=\"42\" style=\"text-align:left;\">42<br />1",
+ "class=\"Has-number smwtype_num\" data-sort-value=\"1001\" style=\"text-align:left;\">1,001<br />21"
+ ]
+ }
+ },
+ {
+ "type": "format",
+ "about": "#2 (+width)",
+ "subject": "Example/F0205/Q.2",
+ "assert-output": {
+ "to-contain": [
+ "<td class=\"Has-number smwtype_num\" data-sort-value=\"42\" style=\"width:50%;\">42<br />1</td>",
+ "<td class=\"Has-number smwtype_num\" data-sort-value=\"1001\" style=\"width:50%;\">1,001<br />21</td>"
+ ]
+ }
+ },
+ {
+ "type": "format",
+ "about": "#3 (+width, +align)",
+ "subject": "Example/F0205/Q.3",
+ "assert-output": {
+ "to-contain": [
+ "<td class=\"Has-number smwtype_num\" data-sort-value=\"42\" style=\"text-align:center; width:50%;\">42<br />1</td>",
+ "<td class=\"Has-number smwtype_num\" data-sort-value=\"1001\" style=\"text-align:center; width:50%;\">1,001<br />21</td>"
+ ]
+ }
+ }
+ ],
+ "settings": {
+ "wgContLang": "en",
+ "wgLang": "en",
+ "smwgNamespacesWithSemanticLinks": {
+ "NS_MAIN": true,
+ "SMW_NS_PROPERTY": true
+ }
+ },
+ "meta": {
+ "version": "2",
+ "is-incomplete": false,
+ "debug": false
+ }
+} \ No newline at end of file