2 return new class() extends \Civi\Test\EventCheck
implements \Civi\Test\HookInterface
{
4 private $validSnippetTypes = [
18 private $validRegion = '/^[A-Za-z0-9\\-]+$/';
21 * Ensure that the hook data is always well-formed.
23 public function on_civi_region_render(\Civi\Core\Event\GenericHookEvent
$e) {
24 $this->assertTrue($e->region
instanceof \CRM_Core_Region
);
25 /** @var \CRM_Core_Region $region */
27 $this->assertRegexp($this->validRegion
, $region->_name
);
28 foreach ($region->getAll() as $snippet) {
29 $this->assertContains($snippet['type'], $this->validSnippetTypes
);