Goal
includes/api/KnowledgeGraphApiLoadNodes.php:99-129 — execute() is completely untested; only getExamplesMessages() is covered.
Test scenarios
- Multiple titles (
|-separated in the titles parameter) are processed individually.
- Unknown/invalid titles (
Title::newFromText() returns null or isKnown() is false) are skipped.
- Interaction with
KnowledgeGraph::getAllPropertiesForNode() (properties are determined and passed on to setSemanticDataFromApi).
- Interaction with
KnowledgeGraph::setSemanticDataFromApi() with the correct parameters (depth=0, $params['depth'] as maxDepth).
- Titles already present in
self::$data are not processed again.
- The result is correctly returned as JSON via
$result->addValue().
Mocking pattern
- SMW store mock via reflection, analogous to
tests/phpunit/Unit/KnowledgeGraphGetSubjectsByPropertyTest.php.
getAllPropertiesForNode() internally uses FauxRequest/ApiMain (smwbrowse) — may require an integration test rather than a pure unit test.
Part of the "raise PHP coverage to ~70%" effort.
Goal
includes/api/KnowledgeGraphApiLoadNodes.php:99-129—execute()is completely untested; onlygetExamplesMessages()is covered.Test scenarios
|-separated in thetitlesparameter) are processed individually.Title::newFromText()returnsnullorisKnown()isfalse) are skipped.KnowledgeGraph::getAllPropertiesForNode()(properties are determined and passed on tosetSemanticDataFromApi).KnowledgeGraph::setSemanticDataFromApi()with the correct parameters (depth=0,$params['depth']as maxDepth).self::$dataare not processed again.$result->addValue().Mocking pattern
tests/phpunit/Unit/KnowledgeGraphGetSubjectsByPropertyTest.php.getAllPropertiesForNode()internally usesFauxRequest/ApiMain(smwbrowse) — may require an integration test rather than a pure unit test.Part of the "raise PHP coverage to ~70%" effort.