4 +--------------------------------------------------------------------+
5 | CiviCRM version 4.3 |
6 +--------------------------------------------------------------------+
7 | Copyright CiviCRM LLC (c) 2004-2013 |
8 +--------------------------------------------------------------------+
9 | This file is a part of CiviCRM. |
11 | CiviCRM is free software; you can copy, modify, and distribute it |
12 | under the terms of the GNU Affero General Public License |
13 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
15 | CiviCRM is distributed in the hope that it will be useful, but |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. |
20 | You should have received a copy of the GNU Affero General Public |
21 | License and the CiviCRM Licensing Exception along |
22 | with this program; if not, contact CiviCRM LLC |
23 | at info[AT]civicrm[DOT]org. If you have questions about the |
24 | GNU Affero General Public License or the licensing of CiviCRM, |
25 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
26 +--------------------------------------------------------------------+
30 +--------------------------------------------------------------------+
31 | CiviCRM version 4.3 |
32 +--------------------------------------------------------------------+
33 | Copyright CiviCRM LLC (c) 2004-2013 |
34 +--------------------------------------------------------------------+
35 | This file is a part of CiviCRM. |
37 | CiviCRM is free software; you can copy, modify, and distribute it |
38 | under the terms of the GNU Affero General Public License |
39 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
41 | CiviCRM is distributed in the hope that it will be useful, but |
42 | WITHOUT ANY WARRANTY; without even the implied warranty of |
43 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
44 | See the GNU Affero General Public License for more details. |
46 | You should have received a copy of the GNU Affero General Public |
47 | License and the CiviCRM Licensing Exception along |
48 | with this program; if not, contact CiviCRM LLC |
49 | at info[AT]civicrm[DOT]org. If you have questions about the |
50 | GNU Affero General Public License or the licensing of CiviCRM, |
51 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
52 +--------------------------------------------------------------------+
55 require_once 'CiviTest/CiviUnitTestCase.php';
58 * Test class for System API - civicrm_system_*
62 class api_v3_SystemTest
extends CiviUnitTestCase
{
64 const TEST_CACHE_GROUP
= 'SystemTest';
65 const TEST_CACHE_PATH
= 'api/v3/system';
66 public $_eNoticeCompliant = TRUE;
70 * Initialize configuration
71 */ function __construct() {
72 parent
::__construct();
76 * Sets up the fixture, for example, opens a network connection.
77 * This method is called before a test is executed.
81 protected function setUp() {
86 * Tears down the fixture, for example, closes a network connection.
87 * This method is called after a test is executed.
91 protected function tearDown() {}
93 ///////////////// civicrm_domain_get methods
98 public function testFlush() {
99 // Note: this operation actually flushes several different caches; we don't
100 // check all of them -- just enough to make sure that the API is doing
103 $this->assertTrue(NULL === CRM_Core_BAO_Cache
::getItem(self
::TEST_CACHE_GROUP
, self
::TEST_CACHE_PATH
));
106 CRM_Core_BAO_Cache
::setItem($data, self
::TEST_CACHE_GROUP
, self
::TEST_CACHE_PATH
);
108 $this->assertEquals('abc', CRM_Core_BAO_Cache
::getItem(self
::TEST_CACHE_GROUP
, self
::TEST_CACHE_PATH
));
113 $result = civicrm_api('system', 'flush', $params);
114 $this->assertAPISuccess($result);
115 $this->documentMe($params, $result, __FUNCTION__
, __FILE__
, "Flush all system caches", 'Flush', 'flush');
117 $this->assertTrue(NULL === CRM_Core_BAO_Cache
::getItem(self
::TEST_CACHE_GROUP
, self
::TEST_CACHE_PATH
));