summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/s-0029.json
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/s-0029.json')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/s-0029.json185
1 files changed, 185 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/s-0029.json b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/s-0029.json
new file mode 100644
index 00000000..41525ec3
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/s-0029.json
@@ -0,0 +1,185 @@
+{
+ "description": "Test `Special:Ask` output on `mainlabel=.../?#...`, `format=table`",
+ "setup": [
+ {
+ "namespace": "SMW_NS_PROPERTY",
+ "page": "Has page",
+ "contents": "[[Has type::Page]]"
+ },
+ {
+ "page": "Example/S0029/1",
+ "contents": "[[Has page::123]] [[Category:S0029]]"
+ }
+ ],
+ "tests": [
+ {
+ "type": "special",
+ "about": "#0 (?#, empty mainlabel)",
+ "special-page": {
+ "page": "Ask",
+ "query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23/mainlabel%3D/offset%3D0/format%3Dtable",
+ "request-parameters": []
+ },
+ "assert-output": {
+ "to-contain": [
+ "<table class=\"sortable wikitable smwtable\">",
+ "<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
+ "<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
+ "<td class=\"smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
+ ]
+ }
+ },
+ {
+ "type": "special",
+ "about": "#0.1 (?, empty mainlabel)",
+ "special-page": {
+ "page": "Ask",
+ "query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F/mainlabel%3D/offset%3D0/format%3Dtable",
+ "request-parameters": []
+ },
+ "assert-output": {
+ "to-contain": [
+ "<table class=\"sortable wikitable smwtable\">",
+ "<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
+ "<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
+ "<td class=\"smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
+ ]
+ }
+ },
+ {
+ "type": "special",
+ "about": "#1 (?#, mainlabel=-, output the same as in #0)",
+ "special-page": {
+ "page": "Ask",
+ "query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23/mainlabel%3D-2D/offset%3D0/format%3Dtable",
+ "request-parameters": []
+ },
+ "assert-output": {
+ "to-contain": [
+ "<table class=\"sortable wikitable smwtable\">",
+ "<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
+ "<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
+ "<td class=\"smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
+ ]
+ }
+ },
+ {
+ "type": "special",
+ "about": "#2 (?#, mainlabel=FOO, ?# takes precedence over mainlabel, same output as in #0)",
+ "special-page": {
+ "page": "Ask",
+ "query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23/mainlabel%3DFOO/offset%3D0/format%3Dtable",
+ "request-parameters": []
+ },
+ "assert-output": {
+ "to-contain": [
+ "<table class=\"sortable wikitable smwtable\">",
+ "<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
+ "<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
+ "<td class=\"smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
+ ]
+ }
+ },
+ {
+ "type": "special",
+ "about": "#3 (?#- forces plain output, empty mainlabel)",
+ "special-page": {
+ "page": "Ask",
+ "query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23-2D/mainlabel%3D/offset%3D0/format%3Dtable",
+ "request-parameters": []
+ },
+ "assert-output": {
+ "to-contain": [
+ "<table class=\"sortable wikitable smwtable\">",
+ "<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th>&nbsp;</th>",
+ "<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
+ "<td class=\"smwtype_wpg\">Example/S0029/1</td>"
+ ]
+ }
+ },
+ {
+ "type": "special",
+ "about": "#4 (?#=Foo, empty mainlabel)",
+ "special-page": {
+ "page": "Ask",
+ "query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23%3DFoo/mainlabel%3D/offset%3D0/format%3Dtable",
+ "request-parameters": []
+ },
+ "assert-output": {
+ "to-contain": [
+ "<table class=\"sortable wikitable smwtable\">",
+ "<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th class=\"Foo\">Foo</th>",
+ "<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
+ "<td class=\"Foo smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
+ ]
+ }
+ },
+ {
+ "type": "special",
+ "about": "#4.1 (?=Foo, empty mainlabel)",
+ "special-page": {
+ "page": "Ask",
+ "query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F%3DFoo/mainlabel%3D/offset%3D0/format%3Dtable",
+ "request-parameters": []
+ },
+ "assert-output": {
+ "to-contain": [
+ "<table class=\"sortable wikitable smwtable\">",
+ "<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th class=\"Foo\">Foo</th>",
+ "<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
+ "<td class=\"Foo smwtype_wpg\"><a href=.*Example/S0029/1\" title=\"Example/S0029/1\">Example/S0029/1</a></td>"
+ ]
+ }
+ },
+ {
+ "type": "special",
+ "about": "#5 (?#=Foo#- forces plain output, empty mainlabel)",
+ "special-page": {
+ "page": "Ask",
+ "query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23%3DFoo-23-2D/mainlabel%3D/offset%3D0/format%3Dtable",
+ "request-parameters": []
+ },
+ "assert-output": {
+ "to-contain": [
+ "<table class=\"sortable wikitable smwtable\">",
+ "<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th class=\"Foo\">Foo</th>",
+ "<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
+ "<td class=\"Foo smwtype_wpg\">Example/S0029/1</td>"
+ ]
+ }
+ },
+ {
+ "type": "special",
+ "about": "#6 (?#=Foo#- forces plain output, mainlabel=-, same output as in #5)",
+ "special-page": {
+ "page": "Ask",
+ "query-parameters": "-5B-5BCategory:S0029-5D-5D/-3FHas-20page/-3F-23%3DFoo-23-2D/mainlabel%3D-2D/offset%3D0/format%3Dtable",
+ "request-parameters": []
+ },
+ "assert-output": {
+ "to-contain": [
+ "<table class=\"sortable wikitable smwtable\">",
+ "<a href=.*Property:Has_page\" title=\"Property:Has page\">Has page</a></th><th class=\"Foo\">Foo</th>",
+ "<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"Has-page smwtype_wpg\" data-sort-value=\"123\">",
+ "<td class=\"Foo smwtype_wpg\">Example/S0029/1</td>"
+ ]
+ }
+ }
+ ],
+ "settings": {
+ "wgContLang": "en",
+ "wgLanguageCode": "en",
+ "smwgPageSpecialProperties": [
+ "_MDAT"
+ ],
+ "smwgNamespacesWithSemanticLinks": {
+ "NS_MAIN": true,
+ "SMW_NS_PROPERTY": true
+ }
+ },
+ "meta": {
+ "version": "2",
+ "is-incomplete": false,
+ "debug": false
+ }
+} \ No newline at end of file