From d2fc9254c5189589dff808693c8e26f74fc92e04 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 10 Jun 2013 22:57:58 +1200 Subject: [PATCH] add test that pinpoints caching problem --- tests/phpunit/api/v3/ACLCachingTest.php | 71 +++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 tests/phpunit/api/v3/ACLCachingTest.php diff --git a/tests/phpunit/api/v3/ACLCachingTest.php b/tests/phpunit/api/v3/ACLCachingTest.php new file mode 100644 index 0000000000..a639bad66d --- /dev/null +++ b/tests/phpunit/api/v3/ACLCachingTest.php @@ -0,0 +1,71 @@ +_apiversion = 3; + + parent::setUp(); + + } +/** + * (non-PHPdoc) + * @see CiviUnitTestCase::tearDown() + */ + function tearDown() { + $tablesToTruncate = array( + 'civicrm_activity', + ); + $this->quickCleanup($tablesToTruncate, TRUE); + } + + function testActivityCreateCustomBefore() { + $values = civicrm_api('custom_field', 'getoptions', array('field' => 'custom_group_id', 'version' => 3)); + $this->assertTrue($values['count'] == 0); + $this->CustomGroupCreate('Activity', 'cachingtest'); + $groupCount = civicrm_api('custom_group', 'getcount', array('version' => 3, 'extends' => 'activity')); + $this->assertEquals($groupCount, 1, 'one group should now exist'); + $values = civicrm_api('custom_field', 'getoptions', array('field' => 'custom_group_id', 'version' => 3)); + $this->assertTrue($values['count'] == 1, 'check that cached value is not retained for custom_group_id'); + } +} + -- 2.25.1