*/
private $tx = NULL;
+ /**
+ * @var CRM_Utils_Hook_UnitTests hookClass
+ * example of setting a method for a hook
+ * $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults'));
+ */
+ public $hookClass = NULL;
+
+ /**
+ * @var array common values to be re-used multiple times within a class - usually to create the relevant entity
+ */
+ protected $_params = array();
+
+ /**
+ * @var CRM_Extension_System
+ */
+ protected $origExtensionSystem;
+
/**
* Constructor
*
$session = CRM_Core_Session::singleton();
$session->set('userID', NULL);
- CRM_Utils_Hook::singleton(TRUE);
$this->errorScope = CRM_Core_TemporaryErrorScope::useException(); // REVERT
// Use a temporary file for STDIN
$GLOBALS['stdin'] = tmpfile();
// when running unit tests, use mockup user framework
$config->setUserFramework('UnitTests');
-
+ $this->hookClass = CRM_Utils_Hook::singleton(TRUE);
// also fix the fatal error handler to throw exceptions,
// rather than exit
$config->fatalErrorHandler = 'CiviUnitTestCase_fatalErrorHandler';
*/
protected function tearDown() {
error_reporting(E_ALL & ~E_NOTICE);
+ CRM_Utils_Hook::singleton()->reset();
+ $this->hookClass->reset();
$session = CRM_Core_Session::singleton();
$session->set('userID', NULL);
* @param null $count
* @throws Exception
* @return array|int
- * @internal param string $type - per http://php.net/manual/en/function.gettype.php possible types
- * - boolean
- * - integer
- * - double
- * - string
- * - array
- * - object
*/
public function callAPISuccessGetCount($entity, $params, $count = NULL) {
$params += array(
class api_v3_ACLPermissionTest extends CiviUnitTestCase {
protected $_apiversion = 3;
- protected $_params;
-
- /**
- * @var CRM_Utils_Hook_UnitTests
- */
- protected $hookClass = NULL;
public $DBResetRequired = FALSE;
-
-
-
protected $_entity;
public function setUp() {
$baoObj = new CRM_Core_DAO();
$baoObj->createTestObject('CRM_Pledge_BAO_Pledge', array(), 1, 0);
$baoObj->createTestObject('CRM_Core_BAO_Phone', array(), 1, 0);
- $this->hookClass = CRM_Utils_Hook::singleton();
$config = CRM_Core_Config::singleton();
$config->userPermissionClass->permissions = array();
}