(NFC) (dev/core#878) Simplify copyright header (tests/*)
[civicrm-core.git] / tests / phpunit / api / v3 / ACLCachingTest.php
CommitLineData
d2fc9254 1<?php
d2fc9254 2/*
3 +--------------------------------------------------------------------+
7d61e75f 4 | Copyright CiviCRM LLC. All rights reserved. |
d2fc9254 5 | |
7d61e75f
TO
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 |
d2fc9254 9 +--------------------------------------------------------------------+
10 */
11
d2fc9254 12/**
13 * This class is intended to test ACL permission using the multisite module
14 *
6c6e6187
TO
15 * @package CiviCRM_APIv3
16 * @subpackage API_Contact
acb109b7 17 * @group headless
d2fc9254 18 */
d2fc9254 19class api_v3_ACLCachingTest extends CiviUnitTestCase {
d2fc9254 20 protected $_params;
b7c9bc4c 21
4e420887 22 public $DBResetRequired = FALSE;
d2fc9254 23
00be9182 24 public function setUp() {
d2fc9254 25 parent::setUp();
d2fc9254 26 }
5896d037 27
6c6e6187
TO
28 /**
29 * (non-PHPdoc)
30 * @see CiviUnitTestCase::tearDown()
31 */
00be9182 32 public function tearDown() {
9099cab3 33 $tablesToTruncate = [
d2fc9254 34 'civicrm_activity',
9099cab3 35 ];
d2fc9254 36 $this->quickCleanup($tablesToTruncate, TRUE);
37 }
38
2d932085
CW
39 /**
40 * @param int $version
41 * @dataProvider versionThreeAndFour
42 */
43 public function testActivityCreateCustomBefore($version) {
44 $this->_apiversion = $version;
9099cab3 45 $values = $this->callAPISuccess('custom_field', 'getoptions', ['field' => 'custom_group_id']);
d2fc9254 46 $this->assertTrue($values['count'] == 0);
9099cab3
CW
47 $this->CustomGroupCreate(['extends' => 'Activity']);
48 $groupCount = $this->callAPISuccess('custom_group', 'getcount', ['extends' => 'activity']);
d2fc9254 49 $this->assertEquals($groupCount, 1, 'one group should now exist');
9099cab3 50 $values = $this->callAPISuccess('custom_field', 'getoptions', ['field' => 'custom_group_id']);
d2fc9254 51 $this->assertTrue($values['count'] == 1, 'check that cached value is not retained for custom_group_id');
52 }
96025800 53
d2fc9254 54}