Should be decoding and not encoding the JSON in the StatsTest as well.
Added second param to json_decode calls; checking that the license hash is sent with the request.