protected function seeJsonContains($expected)
    {
        $response = json_decode($this->response(), true);

        $this->sortJson($expected);
        $this->sortJson($response);

        foreach ($expected as $key => $value) {
            if ( ! str_contains(json_encode($response), trim(json_encode([$key => $value]), '{}'))) {
                $this->fail(sprintf(
                    "Dang! Expected %s to exist in %s, but nope. Ideas?",
                    json_encode($expected), json_encode($response)
                ));
            }
        }

        return $this;
    }
protected function seeJsonContains($expected)
    {
        $response = json_decode($this->response(), true);

        $this->sortJson($expected);
        $this->sortJson($response);

        foreach ($expected as $key => $value) {
            if ( ! str_contains(json_encode($response), trim(json_encode([$key => $value]), '{}'))) {
                $this->fail(sprintf(
                    "Dang! Expected %s to exist in %s, but nope. Ideas?",
                    json_encode($expected), json_encode($response)
                ));
            }
        }

        return $this;
    }
protected function seeJsonContains ( $ expected ) { $ response = json_decode ( $ this -> response ( ) , true ) ; $ this -> sortJson ( $ expected ) ; $ this -> sortJson ( $ response ) ; foreach ( $ expected as $ key => $ value ) { if ( ! str_contains ( json_encode ( $ response ) , trim ( json_encode ( [ $ key => $ value ] ) , '{}' ) ) ) { $ this -> fail ( sprintf ( "Dang! Expected %s to exist in %s, but nope. Ideas?" , json_encode ( $ expected ) , json_encode ( $ response ) ) ) ; } } return $ this ; }
Assert that an API response matches the provided array.

@param  array $expected
@return static
Assert that an API response matches the provided array .