如何为以下代码编写 PHPunit 测试?
public function addOptions()
{
$data['option1'] = [a, b, c];
$data['option2'] = [ab,bc,de];
$data['option3'] = [c, d, e];
$data['option4'] = [dd, ef, fh];
if ((! in_array($data['option1'], $data['option2'] )) || (! in_array($data['option3'], $data['option4']))) {
trigger_error('Value not found in option array!'); // I could see in the coverage that this line is not executed.
}
}
有人可以帮助解决这个问题吗?谢谢