*/
class CRM_Contact_BAO_GroupTest extends CiviUnitTestCase {
- /**
- * Sets up the fixture, for example, opens a network connection.
- *
- * This method is called before a test is executed.
- */
- protected function setUp() {
- parent::setUp();
- }
-
/**
* Tears down the fixture, for example, closes a network connection.
*
* This method is called after a test is executed.
*/
- protected function tearDown() {
+ protected function tearDown(): void {
$this->quickCleanup(['civicrm_mapping_field', 'civicrm_mapping', 'civicrm_group', 'civicrm_saved_search']);
}
'parents' => [
$group2->id => 1,
],
+ 'group_type' => ['2' => 1],
];
$group3 = CRM_Contact_BAO_Group::create($params);
+ unset(Civi::$statics['CRM_Core_Permission_Base']);
// Check with no group type restriction
$nestedGroup = CRM_Core_PseudoConstant::nestedGroup();
$this->assertEquals([
// Check restrict to mailing groups
$nestedGroup = CRM_Core_PseudoConstant::nestedGroup(TRUE, 'Mailing');
- $this->assertSame([$group1->id => 'Parent Group A'], $nestedGroup);
+ $this->assertSame([
+ $group1->id => 'Parent Group A',
+ $group3->id => ' Child Group C',
+ ], $nestedGroup);
}
/**