Skip to content

Commit

Permalink
Fix build after changes in core (#84)
Browse files Browse the repository at this point in the history
* fix build for matomo-org/matomo#21016

* improve test

---------

Co-authored-by: diosmosis <[email protected]>
Co-authored-by: Ben <[email protected]>
Co-authored-by: Michal Kleiner <[email protected]>
  • Loading branch information
4 people authored Jan 5, 2024
1 parent 15e2dd3 commit b07e8e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Integration/SegmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getCommonTestData()
return [
// test multiple column segments
['customVariableName==abc;customVariableValue==def', [
'where' => ' (log_visit.custom_var_k1 = ? OR log_visit.custom_var_k2 = ? OR log_visit.custom_var_k3 = ? OR log_visit.custom_var_k4 = ? OR log_visit.custom_var_k5 = ?) AND (log_visit.custom_var_v1 = ? OR log_visit.custom_var_v2 = ? OR log_visit.custom_var_v3 = ? OR log_visit.custom_var_v4 = ? OR log_visit.custom_var_v5 = ? )',
'where' => ' ( log_visit.custom_var_k1 = ? OR log_visit.custom_var_k2 = ? OR log_visit.custom_var_k3 = ? OR log_visit.custom_var_k4 = ? OR log_visit.custom_var_k5 = ?) AND ( log_visit.custom_var_v1 = ? OR log_visit.custom_var_v2 = ? OR log_visit.custom_var_v3 = ? OR log_visit.custom_var_v4 = ? OR log_visit.custom_var_v5 = ?)',
'bind' => [
'abc', 'abc', 'abc', 'abc', 'abc',
'def', 'def', 'def', 'def', 'def',
Expand Down Expand Up @@ -80,7 +80,7 @@ private function removeExtraWhiteSpaces($valueToFilter)
}
return $valueToFilter;
} else {
return preg_replace('/[\s]+/', ' ', $valueToFilter);
return str_replace(['? )', '( '], ['?)', '('], preg_replace('/[\s]+/', ' ', $valueToFilter));
}
}
}
}

0 comments on commit b07e8e9

Please sign in to comment.