public function test_task_groups() { $org = $this->create_object('org_openpsa_contacts_group_dba'); $org->refresh(); $person = $this->create_object('midcom_db_person'); $this->create_object('midcom_db_member', array('uid' => $person->id, 'gid' => $org->id)); $salesproject = $this->create_object('org_openpsa_sales_salesproject_dba', array('customerContact' => $person->id)); midcom::get('auth')->request_sudo('org.openpsa.helpers'); $result = org_openpsa_helpers_list::task_groups($salesproject); $expected = array(0 => '', $org->id => $org->get_label()); $this->assertEquals($expected, $result); midcom::get('auth')->drop_sudo(); }
/** * Helper function to alter the schema based on the current operation */ private function _modify_schema() { $fields =& $this->_schemadb['default']->fields; $fields['customer']['type_config']['options'] = org_openpsa_helpers_list::task_groups($this->_salesproject); }