(dev/core#174) api_v3_SettingTest - Remove unused cache reference
authorTim Otten <totten@civicrm.org>
Fri, 15 Jun 2018 21:48:57 +0000 (14:48 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 15 Jun 2018 21:51:30 +0000 (14:51 -0700)
This unit is clearing out a non-existent cache item. To see that it is non-existent, I grepped (case-insensitive) for
the expressions:

* `CiviCRM setting Spec`
* `CiviCRM setting `
* `setting spec`

This feels like left-overs from 4.6. In 4.7, the setting cache was reworked. Note that
`SettingTest` does clear newer cache (`Civi::cache('settings')->flush();`).

tests/phpunit/api/v3/SettingTest.php

index a6b2a817a52bd5aebb1990d1131944a26ba52517..1c41fd95658b9b6629dca2e2d79b45fbeebf2b30 100644 (file)
@@ -351,9 +351,6 @@ class api_v3_SettingTest extends CiviUnitTestCase {
   public function testGetExtensionSetting() {
     $this->hookClass->setHook('civicrm_alterSettingsFolders', array($this, 'setExtensionMetadata'));
     $data = NULL;
-    // the caching of data to all duplicates the caching of data to the empty string
-    CRM_Core_BAO_Cache::setItem($data, 'CiviCRM setting Spec', 'All');
-    CRM_Core_BAO_Cache::setItem($data, 'CiviCRM setting Specs', 'settingsMetadata__');
     Civi::cache('settings')->flush();
     $fields = $this->callAPISuccess('setting', 'getfields', array('filters' => array('group_name' => 'Test Settings')));
     $this->assertArrayHasKey('test_key', $fields['values']);