bdd: complete coverage for API tests

Also removes some functions that are no longer used and
fixes debug output where the tests found an issue.
This commit is contained in:
Sarah Hoffmann
2021-01-16 22:20:23 +01:00
parent f9c43137c9
commit 340e7f7210
7 changed files with 94 additions and 17 deletions

View File

@@ -86,18 +86,6 @@ class SearchDescription
$this->sType = $sType;
}
/**
* Check if this might be a full address search.
*
* @return bool True if the search contains name, address and housenumber.
*/
public function looksLikeFullAddress()
{
return (!empty($this->aName))
&& (!empty($this->aAddress) || $this->sCountryCode)
&& preg_match('/[0-9]+/', $this->sHouseNumber);
}
/**
* Check if any operator is set.
*
@@ -1027,7 +1015,7 @@ class SearchDescription
'Name terms (stop words)' => $this->aNameNonSearch,
'Address terms' => $this->aAddress,
'Address terms (stop words)' => $this->aAddressNonSearch,
'Address terms (full words)' => $this->aFullNameAddress,
'Address terms (full words)' => $this->aFullNameAddress ?? '',
'Special search' => $this->iOperator,
'Class' => $this->sClass,
'Type' => $this->sType,
@@ -1039,7 +1027,7 @@ class SearchDescription
public function dumpAsHtmlTableRow(&$aWordIDs)
{
$kf = function ($k) use (&$aWordIDs) {
return $aWordIDs[$k];
return $aWordIDs[$k] ?? '['.$k.']';
};
echo '<tr>';