'<img src=x alert(true)', 'module_name'=>'Accounts'), array('item_summary' => '<script>alert(hi)</script>', 'module_name'=>'Accounts'), ); $out = $view->processRecentRecords($history); foreach($out as $key => $row) { $this->assertEquals($row['item_summary'], $history[$key]['item_summary']); $this->assertNotRegExp('/[<>]/',$row['item_summary_short']); $this->assertContains($history[$key]['item_summary'], $row['image']); } } } class Bug56373TestSugarViewMock extends SugarView { public function processRecentRecords($history) { return parent::processRecentRecords($history); } }