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

141 lines
3.3 KiB
JSON

{
"description": "Test `smw/schema` on `CLASS_CONSTRAINT_SCHEMA` with `mandatory_properties` and `Constraint schema`",
"setup": [
{
"namespace": "SMW_NS_SCHEMA",
"page": "Constraint:MandatoryProperties",
"contents": {
"import-from": "/../Fixtures/p-1110-constraint-mandatory-properties.json"
}
},
{
"namespace": "NS_CATEGORY",
"page": "P1110",
"contents": "[[Constraint schema::Constraint:MandatoryProperties]]"
},
{
"page": "Test:P1110/1",
"contents": "[[Category:P1110]]"
},
{
"page": "Test:P1110/2",
"contents": "[[Mandatory 1::abc]] [[Category:P1110]]"
},
{
"page": "Test:P1110/3",
"contents": "{{#subobject: |@category=Category:P1110}}"
}
],
"tests": [
{
"type": "parser",
"about": "#0",
"namespace": "NS_CATEGORY",
"subject": "P1110",
"assert-store": {
"semantic-data": {
"strict-mode-valuematch": false,
"propertyCount": 3,
"propertyKeys": [
"_CONSTRAINT_SCHEMA",
"_SKEY",
"_MDAT"
]
}
}
},
{
"type": "parser",
"about": "#1 (violation of `mandatory_properties`)",
"subject": "Test:P1110/1",
"assert-store": {
"semantic-data": {
"strict-mode-valuematch": false,
"propertyCount": 4,
"propertyKeys": [
"_SKEY",
"_MDAT",
"_ERRC",
"_INST"
]
}
}
},
{
"type": "parser",
"about": "#2 (violation of `mandatory_properties`, missing two properties)",
"subject": "Test:P1110/1#_ERR080b0f4484ac85bb6dc711fe6befad5a",
"assert-store": {
"semantic-data": {
"strict-mode-valuematch": false,
"propertyCount": 3,
"propertyKeys": [
"_SKEY",
"_ERRT",
"_ERR_TYPE"
],
"propertyValues": [
{ "serialization": "[8,\"smw-constraint-violation-class-mandatory-properties-constraint\",\"Category:P1110\",\"Mandatory 1, Mandatory 2\"]" }
]
}
}
},
{
"type": "parser",
"about": "#3 (violation of `mandatory_properties`, missing one property)",
"subject": "Test:P1110/2#_ERR080b0f4484ac85bb6dc711fe6befad5a",
"assert-store": {
"semantic-data": {
"strict-mode-valuematch": false,
"propertyCount": 3,
"propertyKeys": [
"_SKEY",
"_ERRT",
"_ERR_TYPE"
],
"propertyValues": [
{ "serialization": "[8,\"smw-constraint-violation-class-mandatory-properties-constraint\",\"Category:P1110\",\"Mandatory 2\"]" }
]
}
}
},
{
"type": "parser",
"about": "#4 (violation of `mandatory_properties`, missing two properties, subobject)",
"subject": "Test:P1110/3#_ERR26c6fb10bbd9deefd0ab67e2174845df",
"assert-store": {
"semantic-data": {
"strict-mode-valuematch": false,
"propertyCount": 3,
"propertyKeys": [
"_SKEY",
"_ERRT",
"_ERR_TYPE"
],
"propertyValues": [
{ "serialization": "[8,\"smw-constraint-violation-class-mandatory-properties-constraint\",\"Category:P1110\",\"Mandatory 1, Mandatory 2\"]" }
]
}
}
}
],
"settings": {
"wgContLang": "en",
"wgLang": "en",
"smwgPageSpecialProperties": [
"_MDAT"
],
"smwgNamespacesWithSemanticLinks": {
"NS_MAIN": true,
"NS_CATEGORY": true,
"SMW_NS_PROPERTY": true,
"SMW_NS_SCHEMA": true
}
},
"meta": {
"version": "2",
"is-incomplete": false,
"debug": false
}
}