$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(2, $groups['recordsTotal']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">not-me-active</span>', $groups['data'][4]['group_name']);
+ $this->assertEquals('not-me-active', $groups['data'][0]['title']);
+ $this->assertEquals('pick-me-active', $groups['data'][1]['title']);
}
/**
* Check Group Edit w/o 'edit groups' permission.
+ *
+ * FIXME permissions to edit groups can only be determined by the links, which is ridiculously long
*/
public function testGroupEditWithAndWithoutPermission() {
$this->setPermissionAndRequest('view all contacts');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(2, $groups['recordsTotal']);
- $this->assertEquals('pick-me-active', $groups['data'][2]['group_name']);
- $this->assertEquals('not-me-active', $groups['data'][4]['group_name']);
+ $this->assertEquals('<span><a href="http://civicrm.local/index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $groups['data'][0]['links']);
+ $this->assertEquals('<span><a href="http://civicrm.local/index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a></span>', $groups['data'][1]['links']);
// as per changes made in PR-6822
$this->setPermissionAndRequest(array('view all contacts', 'edit groups'));
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(2, $groups['recordsTotal']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">not-me-active</span>', $groups['data'][4]['group_name']);
+ $this->assertEquals('<span><a href="http://civicrm.local/index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=4" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="http://civicrm.local/index.php?q=civicrm/group&reset=1&action=update&id=4" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="http://civicrm.local/index.php?q=civicrm/group&reset=1&action=delete&id=4" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][0]['links']);
+ $this->assertEquals('<span><a href="http://civicrm.local/index.php?q=civicrm/group/search&reset=1&force=1&context=smog&gid=2" class="action-item crm-hover-button" title=\'Group Contacts\' >Contacts</a><a href="http://civicrm.local/index.php?q=civicrm/group&reset=1&action=update&id=2" class="action-item crm-hover-button" title=\'Edit Group\' >Settings</a></span><span class=\'btn-slide crm-hover-button\'>more<ul class=\'panel\'><li><a href="#" class="action-item crm-hover-button crm-enable-disable" title=\'Disable Group\' >Disable</a></li><li><a href="http://civicrm.local/index.php?q=civicrm/group&reset=1&action=delete&id=2" class="action-item crm-hover-button small-popup" title=\'Delete Group\' >Delete</a></li></ul></span>', $groups['data'][1]['links']);
}
/**
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(2, $groups['recordsTotal']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-active', $groups['data'][0]['title']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][1]['title']);
}
/**
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(2, $groups['recordsTotal']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">not-me-active</span>', $groups['data'][4]['group_name']);
+ $this->assertEquals('not-me-active', $groups['data'][0]['title']);
+ $this->assertEquals('pick-me-active', $groups['data'][1]['title']);
}
/**
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(2, $groups['recordsTotal']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">not-me-active</span>', $groups['data'][4]['group_name']);
+ $this->assertEquals('not-me-active', $groups['data'][0]['title']);
+ $this->assertEquals('pick-me-active', $groups['data'][1]['title']);
}
/**
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(2, $groups['recordsTotal']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">not-me-disabled</span>', $groups['data'][3]['group_name']);
+ $this->assertEquals('not-me-disabled', $groups['data'][0]['title']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][1]['title']);
}
/**
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(1, $groups['recordsTotal']);
- $this->assertEquals('<span class="crm-editable crmf-title">not-me-disabled</span>', $groups['data'][3]['group_name']);
+ $this->assertEquals('not-me-disabled', $groups['data'][0]['title']);
}
/**
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(1, $groups['recordsTotal']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][0]['title']);
}
/**
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$this->assertEquals(4, $groups['recordsTotal']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">not-me-disabled</span>', $groups['data'][3]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">not-me-active</span>', $groups['data'][4]['group_name']);
+ $this->assertEquals('not-me-active', $groups['data'][0]['title']);
+ $this->assertEquals('not-me-disabled', $groups['data'][1]['title']);
+ $this->assertEquals('pick-me-active', $groups['data'][2]['title']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][3]['title']);
}
$this->setPermissionAndRequest('edit groups');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(1, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(1, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(1, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
+ $this->assertEquals('pick-me-active', $groups['data'][0]['title']);
}
public function testTraditionalACLNotFoundTitle() {
$this->setPermissionAndRequest('edit groups');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(2, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(2, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(2, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-active', $groups['data'][0]['title']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][1]['title']);
}
public function testTraditionalACLDisabled() {
$this->setPermissionAndRequest('edit groups');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(1, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(1, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(1, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][0]['title']);
}
public function testTraditionalACLDisabledFoundTitle() {
$this->setPermissionAndRequest('edit groups');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(1, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(1, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(1, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][0]['title']);
}
public function testTraditionalACLDisabledNotFoundTitle() {
$this->setPermissionAndRequest('edit groups');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(1, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(1, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(1, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
+ $this->assertEquals('pick-me-active', $groups['data'][0]['title']);
}
public function testTraditionalACLAll() {
$this->setPermissionAndRequest('edit groups');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(2, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(2, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(2, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-active', $groups['data'][0]['title']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][1]['title']);
}
/**
$this->setHookAndRequest(array('access CiviCRM', 'edit groups'), 'hook_civicrm_aclGroup');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(1, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(1, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(1, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][0]['title']);
}
/**
$this->setHookAndRequest(array('access CiviCRM', 'edit groups'), 'hook_civicrm_aclGroup');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(1, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(1, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(1, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][0]['title']);
}
/**
$this->setHookAndRequest(array('access CiviCRM', 'edit groups'), 'hook_civicrm_aclGroup');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(1, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(1, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(1, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
+ $this->assertEquals('pick-me-active', $groups['data'][0]['title']);
}
/**
public function testGroupListAclGroupHookTitleNotFound() {
$this->_params['title'] = 'n';
$this->setHookAndRequest('access CiviCRM', 'hook_civicrm_aclGroup');
- $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
$params = $this->_params;
+ $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
+ $this->assertEquals(0, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(0, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals(0, $groups['data'], 'Returned groups should exclude disabled by default');
}
/**
public function testGroupListAclGroupHookTitleFound() {
$this->_params['title'] = 'p';
$this->setHookAndRequest(array('access CiviCRM', 'edit groups'), 'hook_civicrm_aclGroup');
+ $params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(2, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(2, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(2, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-active', $groups['data'][0]['title']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][1]['title']);
}
/**
$this->setHookAndRequest(array('access CiviCRM', 'edit groups'), 'hook_civicrm_aclGroup');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(2, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(2, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(2, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-disabled</span>', $groups['data'][1]['group_name']);
+ $this->assertEquals('pick-me-active', $groups['data'][0]['title']);
+ $this->assertEquals('pick-me-disabled', $groups['data'][1]['title']);
}
/**
$this->setHookAndRequest(array('access CiviCRM', 'edit groups'), 'hook_civicrm_aclGroup');
$params = $this->_params;
$groups = CRM_Contact_BAO_Group::getGroupListSelector($params);
- $this->assertEquals(1, $groups['data'], 'Returned groups should exclude disabled by default');
+ $this->assertEquals(1, count($groups['data']), 'Returned groups should exclude disabled by default');
$this->assertEquals(1, $groups['recordsTotal'], 'Total needs to be set correctly');
- $this->assertEquals('<span class="crm-editable crmf-title">pick-me-active</span>', $groups['data'][2]['group_name']);
+ $this->assertEquals('pick-me-active', $groups['data'][0]['title']);
}
/**