diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0443.json')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0443.json | 198 |
1 files changed, 198 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0443.json b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0443.json new file mode 100644 index 00000000..b7897824 --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0443.json @@ -0,0 +1,198 @@ +{ + "description": "Test conditions and strict constraint validations for uniqueness `_PVUC` on `_txt`/`_rec`/`_ref_rec` with unique field (#1463, #3547, `smwgDVFeatures`)", + "setup": [ + { + "namespace": "SMW_NS_PROPERTY", + "page": "Has uniqueness one", + "contents": "[[Has type::Text]] [[Has uniqueness constraint::true]]" + }, + { + "namespace": "SMW_NS_PROPERTY", + "page": "Has uniqueness two", + "contents": "[[Has type::Text]] [[Has uniqueness constraint::true]]" + }, + { + "namespace": "SMW_NS_PROPERTY", + "page": "Unique field", + "contents": "[[Has type::Text]] [[Has uniqueness constraint::true]]" + }, + { + "namespace": "SMW_NS_PROPERTY", + "page": "Another unique field", + "contents": "[[Has type::Text]] [[Has uniqueness constraint::true]]" + }, + { + "namespace": "SMW_NS_PROPERTY", + "page": "Unique record", + "contents": "[[Has type::Record]] [[Has fields::Unique field;Non unique field]]" + }, + { + "namespace": "SMW_NS_PROPERTY", + "page": "Unique reference", + "contents": "[[Has type::Reference]] [[Has fields::Unique field;Another unique field;Non unique field]]" + }, + { + "page": "Example/P0443/1", + "contents": "[[Has uniqueness one::Allowed one]] [[Has uniqueness one::Not permitted]] [[Has uniqueness two::Allowed two]] [[Has uniqueness two::Not permitted]]" + }, + { + "page": "Example/P0443/2", + "contents": "[[Has uniqueness one::1111]] {{#ask: [[Has uniqueness one::1111]] |link=none |format=plainlist}}" + }, + { + "page": "Example/P0443/3", + "contents": "[[Unique record::abc;123]]" + }, + { + "page": "Example/P0443/4", + "contents": "[[Unique record::abc;123]] (fails on abc)" + }, + { + "page": "Example/P0443/5", + "contents": "[[Unique reference::abc;def;123]] (fails on abc)" + }, + { + "page": "Example/P0443/6", + "contents": "[[Unique reference::abcd;def;123]]" + }, + { + "page": "Example/P0443/7", + "contents": "[[Unique reference::abcde;def;123]] (fails on def)" + } + ], + "tests": [ + { + "type": "parser", + "about": "#0 (verify uniqueness for only one assignment per property)", + "subject": "Example/P0443/1", + "store": { + "clear-cache": true + }, + "assert-store": { + "semantic-data": { + "strictPropertyValueMatch": false, + "propertyCount": 5, + "propertyKeys": [ + "_MDAT", + "_SKEY", + "_ERRC", + "Has uniqueness one", + "Has uniqueness two" + ], + "propertyValues": [ + "Allowed one", + "Allowed two" + ] + } + } + }, + { + "type": "parser", + "about": "#1 (verify declared unique value doesn't interfere with #ask within the same page)", + "subject": "Example/P0443/2", + "assert-output": { + "to-contain": [ + "<p>1111 Example/P0443/2" + ] + } + }, + { + "type": "parser", + "about": "#2 (verify uniqueness of field in record )", + "subject": "Example/P0443/3", + "assert-store": { + "semantic-data": { + "strictPropertyValueMatch": false, + "propertyCount": 3, + "propertyKeys": [ + "_MDAT", + "_SKEY", + "Unique record" + ], + "propertyValues": [ + "abc; 123" + ] + } + } + }, + { + "type": "parser", + "about": "#3 (verify uniqueness of field in record fails for same value as used in Example/P0443/3)", + "subject": "Example/P0443/4", + "assert-store": { + "semantic-data": { + "strictPropertyValueMatch": false, + "propertyCount": 3, + "propertyKeys": [ + "_MDAT", + "_SKEY", + "_ERRC" + ] + } + } + }, + { + "type": "parser", + "about": "#4 (verify uniqueness of field in reference fails for same value as used in Example/P0443/3)", + "subject": "Example/P0443/5", + "assert-store": { + "semantic-data": { + "strictPropertyValueMatch": false, + "propertyCount": 3, + "propertyKeys": [ + "_MDAT", + "_SKEY", + "_ERRC" + ] + } + } + }, + { + "type": "parser", + "about": "#5 (verify uniqueness for reference with uniqueness fields)", + "subject": "Example/P0443/6", + "assert-store": { + "semantic-data": { + "strictPropertyValueMatch": false, + "propertyCount": 3, + "propertyKeys": [ + "_MDAT", + "_SKEY", + "Unique reference" + ], + "propertyValues": [ + "abcd" + ] + } + } + }, + { + "type": "parser", + "about": "#6 (verify uniqueness of field in reference fails for same value as used in Example/P0443/6)", + "subject": "Example/P0443/7", + "assert-store": { + "semantic-data": { + "strictPropertyValueMatch": false, + "propertyCount": 3, + "propertyKeys": [ + "_MDAT", + "_SKEY", + "_ERRC" + ] + } + } + } + ], + "settings": { + "smwgDVFeatures": [ + "SMW_DV_PVUC" + ], + "wgContLang": "en", + "wgLang": "en" + }, + "meta": { + "version": "2", + "is-incomplete": false, + "debug": false + } +}
\ No newline at end of file |