Open edmondop opened 6 years ago
This resolves the problem that test would fail in some organization due to order of generation of query parameters.
If one runs for example Twilio_TestPhoneNumbers.testTwilioAvailablePhoneNumbers_AreaCodeFilter
Twilio_TestPhoneNumbers.testTwilioAvailablePhoneNumbers_AreaCodeFilter
on an organization where tests fail, one can read on the log
15:25:48:017 USER_DEBUG [98]|DEBUG|Twilio_TestHTTPMock::putResponse() Added resource GET HTTPS://API.TWILIO.COM/2010-04-01/ACCOUNTS/ACBA8BC05EACF94AFDAE398E642C9CC32D/AVAILABLEPHONENUMBERS/US/LOCAL.JSON?AREACODE=510&CONTAINS=51034***** .... 15:25:48:264 USER_DEBUG [77]|DEBUG|Twilio_TestHTTPMock::getResponse() Did not find Resource for GET https://api.twilio.com/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/AvailablePhoneNumbers/US/Local.json?Contains=51034*****&AreaCode=510
15:25:48:017 USER_DEBUG [98]|DEBUG|Twilio_TestHTTPMock::putResponse() Added resource GET HTTPS://API.TWILIO.COM/2010-04-01/ACCOUNTS/ACBA8BC05EACF94AFDAE398E642C9CC32D/AVAILABLEPHONENUMBERS/US/LOCAL.JSON?AREACODE=510&CONTAINS=51034*****
.... 15:25:48:264 USER_DEBUG [77]|DEBUG|Twilio_TestHTTPMock::getResponse() Did not find Resource for GET https://api.twilio.com/2010-04-01/Accounts/ACba8bc05eacf94afdae398e642c9cc32d/AvailablePhoneNumbers/US/Local.json?Contains=51034*****&AreaCode=510
As you can see the order of the query parameters AreaCode/Contains is inverted and therefore it fails to find the resource and answer with a 404
This resolves the problem that test would fail in some organization due to order of generation of query parameters.
If one runs for example
Twilio_TestPhoneNumbers.testTwilioAvailablePhoneNumbers_AreaCodeFilter
on an organization where tests fail, one can read on the log
As you can see the order of the query parameters AreaCode/Contains is inverted and therefore it fails to find the resource and answer with a 404