public function dumpAsConsoleText()
 {
     $output = '';
     $useCaseView = new UseCaseView();
     $output .= $useCaseView->view($this->spec);
     if ($this->getStatusCodeViolation()) {
         $output .= $this->getStatusCodeViolation() . "\n";
     } else {
         $output .= sprintf("\t\tResponse code is <info>%s</info>\n", $this->getResponse()->getStatusCode());
     }
     if ($this->getHeadersViolations()) {
         foreach ($this->getHeadersViolations() as $violation) {
             $output .= $violation . "\n";
         }
     } else {
         $output .= sprintf("\t\tResponse has following required headers:\n");
         foreach ($this->responseSpec->getRequiredHeaders() as $headerName => $headerValue) {
             $output .= sprintf("\t\t\t<info>%s: %s</info>\n", $headerName, $headerValue);
         }
     }
     $output .= "\n";
     if (!$this->getBodyViolations()) {
         $actualBody = (string) $this->getResponse()->getBody();
         $json = json_decode($actualBody);
         if ($json) {
             $bodyStr = json_encode($json, JSON_PRETTY_PRINT);
         } else {
             $bodyStr = $json;
         }
         $output .= "\t\tResponse body is valid:\n\n\n";
         $output .= sprintf("<info>%s</info>\n\n\n", \RestSpec\Output\indentValue($bodyStr, 2));
     } else {
         foreach ($this->getBodyViolations() as $violation) {
             $output .= $violation . "\n";
         }
     }
     return $output;
 }