3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This class is intended to test ACL permission using the multisite module
15 * @package CiviCRM_APIv3
16 * @subpackage API_Contact
19 class api_v3_ACLCachingTest
extends CiviUnitTestCase
{
22 public $DBResetRequired = FALSE;
24 public function setUp() {
30 * @see CiviUnitTestCase::tearDown()
32 public function tearDown() {
36 $this->quickCleanup($tablesToTruncate, TRUE);
41 * @dataProvider versionThreeAndFour
43 public function testActivityCreateCustomBefore($version) {
44 $this->_apiversion
= $version;
45 $values = $this->callAPISuccess('custom_field', 'getoptions', ['field' => 'custom_group_id']);
46 $this->assertTrue($values['count'] == 0);
47 $this->CustomGroupCreate(['extends' => 'Activity']);
48 $groupCount = $this->callAPISuccess('custom_group', 'getcount', ['extends' => 'activity']);
49 $this->assertEquals($groupCount, 1, 'one group should now exist');
50 $values = $this->callAPISuccess('custom_field', 'getoptions', ['field' => 'custom_group_id']);
51 $this->assertTrue($values['count'] == 1, 'check that cached value is not retained for custom_group_id');