Fix unit tests for older than PHP 5.5.12

Since PHP 5.5.12 JSON format changed and we need to adapt
our tests to be compatible with both earlier and older version of PHP