From #2643408: Implement a more intelligent SMS Gateway selection mechanism for SMS Framework #53
There's a bug in this hunk
public function getGatewaysSorted() {
$gateways = $this->gateways;
uasort($gateways, function($a, $b) {
list(, $priority_a) = $a;
list(, $priority_b) = $b;
if ($priority_a == $priority_b) {
return 0;
}
return ($priority_a > $priority_b) ? -1 : 1;
});
$gateways = [];
foreach ($gateways as $tuple) {
list($gateway, ) = $tuple;
$gateways[] = $gateway;
}
return $gateways;
}
Where $gateways = [] is initialized then iterated over. It also means we need tests for that class.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | gateway-event-test-coverage-2787259-3.patch | 12.38 KB | dpi |
| #2 | gateway-event-test-coverage-2787259.patch | 6.9 KB | dpi |
Comments
Comment #2
dpihttps://github.com/dpi/smsframework/pull/47
Comment #3
dpiAdd ID detect to createMemoryGateway so the id passed to settings is correct.
Added test coverage to make sure the gateway event is invoked.
Comment #5
dpi