// Verify that a few key modules, themes, and profiles are listed, so that
// we can be certain our directory list is complete and we will be testing
// all existing help topics. If these lines in the test fail in the future,
// it is probably because something we chose to list here is being removed.
// Substitute another item of the same type that still exists, so that this
// test can continue.
$this->
assertArrayHasKey('system',
$directories, 'System module is being scanned'
);
$this->
assertArrayHasKey('help',
$directories, 'Help module is being scanned'
);
$this->
assertArrayHasKey('claro',
$directories, 'Claro theme is being scanned'
);
$this->
assertArrayHasKey('standard',
$directories, 'Standard profile is being scanned'
);
$definitions =
(new HelpTopicDiscovery($directories))->
getDefinitions();
$this->
assertGreaterThan(0,
count($definitions), 'At least 1 topic was found'
);
// Test each topic for compliance with standards, or for failing in the
// right way.
foreach (array_keys($definitions) as $id) { if (str_starts_with($id, 'bad_help_topics.'
)) { $this->
verifyBadTopic($id,
$definitions);
} else { $this->
verifyTopic($id,
$definitions);
} }