Merge pull request #11250 from agh1/no-update-indices
[civicrm-core.git] / tests / phpunit / Civi / Core / CiviEventInspectorTest.php
index 36482f13f1b00f87b3ed123503e7e3bccdcb5c9b..144232d50f709c39ecb1da4899e913849e0bf814 100644 (file)
@@ -12,11 +12,14 @@ class CiviEventInspectorTest extends \CiviUnitTestCase {
     $eventDef = $inspector->get('hook_civicrm_alterSettingsMetaData');
     $this->assertEquals('hook_civicrm_alterSettingsMetaData', $eventDef['name']);
     $this->assertEquals(array('settingsMetaData', 'domainID', 'profile'), array_keys($eventDef['fields']));
-    $this->assertTrue($eventDef['is_hook']);
+    $this->assertEquals('hook', $eventDef['type']);
+    $this->assertNotEmpty($eventDef['description_html']);
     $this->assertTrue($eventDef['fields']['settingsMetaData']['ref']);
     $this->assertFalse($eventDef['fields']['domainID']['ref']);
     $this->assertEquals('&$settingsMetaData, $domainID, $profile', $eventDef['signature']);
     $this->assertTrue($inspector->validate($eventDef));
+    $this->assertTrue($eventDef['stub'] instanceof \ReflectionMethod);
+    $this->assertTrue($eventDef['stub']->isStatic());
   }
 
   public function testGetAll() {
@@ -26,8 +29,11 @@ class CiviEventInspectorTest extends \CiviUnitTestCase {
     $this->assertTrue(isset($all['hook_civicrm_alterSettingsMetaData']));
     foreach ($all as $name => $eventDef) {
       $this->assertEquals($name, $eventDef['name']);
-      $this->assertNotEmpty($eventDef['description_html']);
       $this->assertTrue($inspector->validate($eventDef));
+      if (isset($eventDef['stub'])) {
+        $this->assertTrue($eventDef['stub'] instanceof \ReflectionMethod);
+        $this->assertTrue($eventDef['stub']->isStatic());
+      }
     }
   }