*/
public function onInstall() {
$config = \CRM_Core_Config::singleton();
- if (!($config->userPermissionClass instanceof \CRM_Core_Permission_Standalone)) {
+ // We generally only want to run on standalone. In theory, we might also run headless tests.
+ if (!in_array(get_class($config->userPermissionClass), ['CRM_Core_Permission_Standalone', 'CRM_Core_Permission_Headless'])) {
throw new \CRM_Core_Exception("standaloneusers can only be installed on standalone");
}
- if (!($config->userSystem instanceof \CRM_Utils_System_Standalone)) {
+ if (!in_array(get_class($config->userSystem), ['CRM_Utils_System_Standalone', 'CRM_Utils_System_Headless'])) {
throw new \CRM_Core_Exception("standaloneusers can only be installed on standalone");
}
parent::onInstall();