bigcommerce / bigcommerce-api-php

Connect PHP applications with the Bigcommerce Platform
https://developer.bigcommerce.com
MIT License
144 stars 186 forks source link

Need to force string when constructing error classes #252

Open carsonreinke opened 5 years ago

carsonreinke commented 5 years ago

What?

Some responses incorrectly throw error messages because there is a type mismatch on the arguments to the error constructors. Basically, json_decode on the response body is not guaranteed to return a string. We need to enforce the string.

Writing test cases involved a lot of work unless a curl abstraction was built/used. Even mocking is extremely difficult here.

Tickets / Documentation

https://github.com/bigcommerce/bigcommerce-api-php/issues/223

Screenshots (if appropriate)

None

cc @jofomah

carsonreinke commented 4 years ago

Hello? @bookernath