forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHookInterface.php
30 lines (28 loc) · 885 Bytes
/
HookInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
namespace Civi\Test;
/**
* Interface HookInterface
* @package Civi\Test
*
* This interface allows you to subscribe to hooks as part of the test.
* Simply create an eponymous hook function (e.g. `hook_civicrm_post()`).
*
* @code
* class MyTest extends \PHPUnit_Framework_TestCase implements \Civi\Test\HookInterface {
* public function hook_civicrm_post($op, $objectName, $objectId, &$objectRef) {
* echo "Running hook_civicrm_post\n";
* }
* }
* @endCode
*
* At time of writing, there are a few limitations in how HookInterface is handled
* by CiviTestListener:
*
* - The test must execute in-process (aka HeadlessInterface; aka CIVICRM_UF==UnitTests).
* End-to-end tests (multi-process tests) are not supported.
* - Early bootstrap hooks (e.g. hook_civicrm_config) are not supported.
*
* @see CiviTestListener
*/
interface HookInterface {
}