Merge pull request #17253 from mattwire/utf8convertblocksize
[civicrm-core.git] / tests / phpunit / CRM / Core / BAO / ConfigSettingTest.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * Class CiviReportTestCase
14 * @group headless
15 */
16 class CRM_Core_BAO_ConfigSettingTest extends CiviUnitTestCase {
17
18 public function testToggleComponent() {
19 $origNames = [];
20 foreach (CRM_Core_Component::getEnabledComponents() as $c) {
21 $origNames[] = $c->name;
22 }
23 $this->assertTrue(!in_array('CiviCase', $origNames));
24
25 $enableResult = CRM_Core_BAO_ConfigSetting::enableComponent('CiviCase');
26 $this->assertTrue($enableResult, 'Cannot enable CiviCase in line ' . __LINE__);
27
28 $newNames = [];
29 foreach (CRM_Core_Component::getEnabledComponents() as $c) {
30 $newNames[] = $c->name;
31 }
32
33 $this->assertTrue(in_array('CiviCase', $newNames));
34 $this->assertEquals(count($newNames), count($origNames) + 1);
35 }
36
37 }