Laravel\Lumen\Testing\Concerns\MakesHttpRequests::formatToExpectedJson PHP Метод

formatToExpectedJson() защищенный Метод

Format the given key and value into a JSON string for expectation checks.
protected formatToExpectedJson ( string $key, mixed $value ) : string
$key string
$value mixed
Результат string
    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 $expected;
    }