\Civi\API\Provider\AdhocProvider - Bump priority
authorTim Otten <totten@civicrm.org>
Fri, 23 May 2014 23:33:24 +0000 (16:33 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 26 May 2014 20:04:27 +0000 (13:04 -0700)
Civi/API/Provider/AdhocProvider.php

index e5a5d7a407722985f6a809880c6242d768598e2f..35cca808b7c145d69c792e2d1b2a6da274494c07 100644 (file)
@@ -38,12 +38,15 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface {
    * @return array
    */
   public static function getSubscribedEvents() {
+    // Using a high priority allows adhoc implementations
+    // to override standard implementations -- which is
+    // handy for testing/mocking.
     return array(
       Events::RESOLVE => array(
-        array('onApiResolve', Events::W_MIDDLE),
+        array('onApiResolve', Events::W_EARLY),
       ),
       Events::AUTHORIZE => array(
-        array('onApiAuthorize', Events::W_MIDDLE),
+        array('onApiAuthorize', Events::W_EARLY),
       ),
     );
   }