function total_abuse($id, $type) { $report_abuse_obj = new ReportAbuse(); $report_abuse_obj->parent_type = $type; $report_abuse_obj->parent_id = $id; $result = $report_abuse_obj->get_multiples(); return count($result); }
public function testGet_multiples_with_ReportId() { $report_abuse_obj = new ReportAbuse(); $report_abuse_obj->report_id = 2; $result = $report_abuse_obj->get_multiples(); $field = 'report_id = ?'; $sql = "SELECT report_id, parent_type, parent_id, body, created, reporter_id\n FROM {report_abuse} \n WHERE {$field}"; $data = array($report_abuse_obj->report_id); $res = Dal::query($sql, $data); $test_result = array(); if ($res->numRows()) { while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) { $test_result[] = $row; } } $this->assertEquals($result, $test_result); }