public function testCRUD() { midcom::get('auth')->request_sudo('org.openpsa.reports'); $query = new org_openpsa_reports_query_dba(); $stat = $query->create(); $this->assertTrue($stat); $this->register_object($query); $query = new org_openpsa_reports_query_dba($query->guid); $this->assertEquals('.html', $query->extension); $this->assertEquals(ORG_OPENPSA_OBTYPE_REPORT_TEMPORARY, $query->orgOpenpsaObtype); $this->assertEquals('text/html', $query->mimetype); $this->assertEquals('unnamed', $query->title); $query->title = 'TEST'; $stat = $query->update(); $this->assertTrue($stat); $query->refresh(); $this->assertEquals('TEST', $query->title); $stat = $query->delete(); $this->assertTrue($stat); midcom::get('auth')->drop_sudo(); }
/** * Delete the given report and redirect to front page * * @param mixed $handler_id The ID of the handler. * @param Array $args The argument list. * @param Array &$data The local request data. */ public function _handler_delete_report($handler_id, array $args, array &$data) { $report = new org_openpsa_reports_query_dba($args[0]); $report->delete(); return new midcom_response_relocate(''); }