From: eileen Date: Mon, 10 Jun 2013 10:57:58 +0000 (+1200) Subject: add test that pinpoints caching problem X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d2fc9254c5189589dff808693c8e26f74fc92e04;p=civicrm-core.git add test that pinpoints caching problem --- 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'); + } +} +