src/Concerns/MakesHttpRequests.php
protected function formatToExpectedJson($key, $value)
    {
        $expected = json_encode([$key => $value]);

        if (Str::startsWith($expected, '{')) {
            $expected = substr($expected, 1);
        }

        if (Str::endsWith($expected, '}')) {
            $expected = substr($expected, 0, -1);
        }

        return trim($expected);
    }
protected function formatToExpectedJson($key, $value)
    {
        $expected = json_encode([$key => $value]);

        if (Str::startsWith($expected, '{')) {
            $expected = substr($expected, 1);
        }

        if (Str::endsWith($expected, '}')) {
            $expected = substr($expected, 0, -1);
        }

        return trim($expected);
    }
protected function formatToExpectedJson ( $ key , $ value ) { $ expected = json_encode ( [ $ key => $ value ] ) ; if ( Str :: startsWith ( $ expected , '{' ) ) { $ expected = substr ( $ expected , 1 ) ; } if ( Str :: endsWith ( $ expected , '}' ) ) { $ expected = substr ( $ expected , 0 , - 1 ) ; } return trim ( $ expected ) ; }
Format the given key and value into a JSON string for expectation checks.

@param  string  $key
@param  mixed  $value
@return string
Format the given key and value into a JSON string for expectation checks .