Merge pull request #17253 from mattwire/utf8convertblocksize
[civicrm-core.git] / tests / phpunit / CRM / Core / BAO / ConfigSettingTest.php
CommitLineData
edbcbd96
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
7d61e75f 4 | Copyright CiviCRM LLC. All rights reserved. |
edbcbd96 5 | |
7d61e75f
TO
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 |
edbcbd96
TO
9 +--------------------------------------------------------------------+
10 */
11
edbcbd96
TO
12/**
13 * Class CiviReportTestCase
acb109b7 14 * @group headless
edbcbd96
TO
15 */
16class CRM_Core_BAO_ConfigSettingTest extends CiviUnitTestCase {
39b959db 17
edbcbd96 18 public function testToggleComponent() {
9099cab3 19 $origNames = [];
edbcbd96
TO
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
9099cab3 28 $newNames = [];
edbcbd96
TO
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}