<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
- *
- * @access protected
*/
protected function setUp() {
parent::setUp();
+ $this->useTransaction(TRUE);
CRM_Utils_Hook_UnitTests::singleton()->setHook('civicrm_apiWrappers', array($this, 'onApiWrappers'));
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
- *
- * @access protected
*/
protected function tearDown() {
parent::tearDown();
* @param $apiWrappers
* @param $apiRequest
*/
- function onApiWrappers(&$apiWrappers, $apiRequest) {
+ public function onApiWrappers(&$apiWrappers, $apiRequest) {
$this->assertTrue(is_string($apiRequest['entity']) && !empty($apiRequest['entity']));
$this->assertTrue(is_string($apiRequest['action']) && !empty($apiRequest['action']));
$this->assertTrue(is_array($apiRequest['params']) && !empty($apiRequest['params']));
$apiWrappers[] = new api_v3_APIWrapperTest_Impl();
}
- function testWrapperHook() {
+ public function testWrapperHook() {
// Note: this API call would fail due to missing contact_type, but
// the wrapper intervenes (fromApiInput)
// Note: The output would define "display_name", but the wrapper