I can't get PHPUnit's Code Coverage tool to mark this else statement as covered even though it must be or the following line could not be covered. Elsewhere in the same class another line that contains only } else { is correctly marked as covered.
if (is_string($externalId) && $externalId != '') {
$sitesIds[] = $externalId;
} else if ($regionName != null && $regionName != '') {
$sitesIds = $this->sitesService->getSites($regionName);
if (!is_array($sitesIds) || count($sitesIds) == 0) {
throw new \Exception(self::NO_MATCHING_REGION, '404');
}
} else {
throw new \Exception(self::BAD_REQUEST.'. Should specify station or region', '400');
}


else {to separate line chang things?else {is white, meaning it isn't intended to be covered/tested