protected function fillMock($mock, $attributes = []) { $instance = $mock->makePartial(); foreach ($attributes as $key => $value) { $instance->{$key} = $value; } return $instance; }