public function seeResponseIsJson()
    {
        $responseContent = $this->connectionModule->_getResponseContent();
        \PHPUnit\Framework\Assert::assertNotEquals('', $responseContent, 'response is empty');
        json_decode($responseContent);
        $errorCode = json_last_error();
        $errorMessage = json_last_error_msg();
        \PHPUnit\Framework\Assert::assertEquals(
            JSON_ERROR_NONE,
            $errorCode,
            sprintf(
                "Invalid json: %s. System message: %s.",
                $responseContent,
                $errorMessage
            )
        );
    }
public function seeResponseIsJson()
    {
        $responseContent = $this->connectionModule->_getResponseContent();
        \PHPUnit\Framework\Assert::assertNotEquals('', $responseContent, 'response is empty');
        json_decode($responseContent);
        $errorCode = json_last_error();
        $errorMessage = json_last_error_msg();
        \PHPUnit\Framework\Assert::assertEquals(
            JSON_ERROR_NONE,
            $errorCode,
            sprintf(
                "Invalid json: %s. System message: %s.",
                $responseContent,
                $errorMessage
            )
        );
    }
public function seeResponseIsJson ( ) { $ responseContent = $ this -> connectionModule -> _getResponseContent ( ) ; \ PHPUnit \ Framework \ Assert :: assertNotEquals ( '' , $ responseContent , 'response is empty' ) ; json_decode ( $ responseContent ) ; $ errorCode = json_last_error ( ) ; $ errorMessage = json_last_error_msg ( ) ; \ PHPUnit \ Framework \ Assert :: assertEquals ( JSON_ERROR_NONE , $ errorCode , sprintf ( "Invalid json: %s. System message: %s." , $ responseContent , $ errorMessage ) ) ; }
Checks whether last response was valid JSON.
This is done with json_last_error function.

@part json
Checks whether last response was valid JSON . This is done with json_last_error function .