I gave a getFooAttribute method that returns a value depending on the format of some field.
public function getFooAttribute()
{
$re = 'some regex /';
if(preg_match($re, $this->bar) === 1){
return 'normal'. $this->bar;
}
return 'not normal'. $this->bar;
}
Now I would like to write tests for when a field is a certain value. How can I do this?