I'm writing a Functional test (extending BrowserTestBase) for a Drupal REST resource. My resource works fine in real life, but the test (running with --verbose and --debug options) throws a server error

...resulted in a '500 500 Service unavailable (with message)' response: The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Component\P (truncated...)

This happens when I make the request, before I can try to catch it in an assertion. I'm pretty sure that truncated output has the information I need to solve this, but I'm having no luck getting to it. Drupal console docs say there's a test:run command but when I try that (v1.8.0), it tells me that's not a valid command name. I've tried running my test through the debugger but no help there, either.

Is there any way I can get to see what's in the truncated part of the response?


My problem stemmed from trying to use GuzzleHttp to make my request, instead of BrowserTestBase::drupalGet(). I still don't know about getting to that truncated output, but using drupalGet() returns the output without truncating.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.