Goal
includes/KnowledgeGraph.php:377-439 — currently untested; used among others by KnowledgeGraphApiLoadNodes::execute().
Test scenarios
- Unknown/invalid title → empty array (early return).
- Exclude list (
self::$exclude) filters out predefined SMW properties.
- Properties with a leading
_ or ___ are filtered.
- Uppercase heuristic: properties that consist entirely of uppercase letters after removing
_ (ctype_upper) are filtered.
- Inverse direction (
direction === 'inverse') produces a - prefix in the result.
- Deduplication via
array_unique() at the end.
- Empty/missing
query.data in the API response → empty array.
Mocking pattern
- Internally uses
FauxRequest/ApiMain (action smwbrowse) — similar to the "tests for the main path of setSemanticDataFromApi" issue. Consider a shared test fixture/helper for SMW browse API mocking between both issues.
Part of the "raise PHP coverage to ~70%" effort.
Goal
includes/KnowledgeGraph.php:377-439— currently untested; used among others byKnowledgeGraphApiLoadNodes::execute().Test scenarios
self::$exclude) filters out predefined SMW properties._or___are filtered._(ctype_upper) are filtered.direction === 'inverse') produces a-prefix in the result.array_unique()at the end.query.datain the API response → empty array.Mocking pattern
FauxRequest/ApiMain(actionsmwbrowse) — similar to the "tests for the main path of setSemanticDataFromApi" issue. Consider a shared test fixture/helper for SMW browse API mocking between both issues.Part of the "raise PHP coverage to ~70%" effort.