Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions tests/phpunit/Integration/JSONScript/TestCases/incoming-01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"name": "Test for SRF #614: on making output from query with format=incoming re-usable.",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has incoming property (text)",
"contents": "[[Has type::Text]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has incoming property (page)",
"contents": "[[Has type::Page]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Is related to",
"contents": "[[Has type::Page]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Not to be confused with",
"contents": "[[Has type::Page]]"
},
{
"namespace": "NS_TEMPLATE",
"page": "AddPropertyPrefixToName",
"contents": "<includeonly>Property:{{{1|}}}</includeonly>"
},
{
"page": "Example/SRF0614/D.1",
"contents": "{{#set: Has incoming property (text)={{#ask: [[{{FULLPAGENAME}}]] |format=incoming |limit=999 |sep=; }}|+sep=; \n|Has incoming property (page)={{#ask: [[{{FULLPAGENAME}}]] |format=incoming |limit=999 |template=AddPropertyPrefixToName |sep=; }}|+sep=; }}"
},
{
"page": "Example/SRF0614/D.2",
"contents": "{{#set:Is related to=Example/SRF0614/D.1}}"
},
{
"page": "Example/SRF0614/D.3",
"contents": "{{#set:Is related to=Example/SRF0614/D.1 |Not to be confused with=Example/SRF0614/D.1 }}"
},
{
"page": "Example/SRF0614/Q.1",
"contents": "<div>{{#show: Example/SRF0614/D.1 |?Has incoming property (text)|+order=asc |valuesep=; }}</div>"
},
{
"page": "Example/SRF0614/Q.2",
"contents": "<div>{{#show: Example/SRF0614/D.1 |?Has incoming property (page)|+order=asc |link=none |valuesep=; }}</div>"
}
],

"tests": [
{
"type": "format",
"about": "Check output using #show (properties without namespace prefixes). Should not have a div with class='srf-incoming'.",
"subject": "Example/F0104/Q.1",
"assert-output": {
"to-contain": [
"<div>Is related to;Not to be confused with</div>"
]
}
},
{
"type": "format",
"about": "Check output using #show (properties with namespace prefixes added through template). Should not have a div with class='srf-incoming'.",
"subject": "Example/F0104/Q.2",
"assert-output": {
"to-contain": [
"<div>Property:Is related to;Property:Not to be confused with</div>"
]
}
}
],

"settings": {
"wgContLang": "en",
"wgLang": "en",
"smwgNamespacesWithSemanticLinks": {
"NS_MAIN": true,
"SMW_NS_PROPERTY": true
}
},
"meta": {
"version": "2",
"is-incomplete": false,
"debug": false
}
}
Loading