testing - how to set HTTP_HOST for WebTestCases in Symfony2 -


my application generating absolute links via $this->get('request')->gethost(). problem is: when try run testcases, following error message:

[exception] 500 | internal server error | twig_error_runtime

[message] exception has been thrown during rendering of template ("undefined index: http_host") in "::base.html.twig" @ line 69.

somehow it's clear me there no host when calling app via cli, think there must way prevent symfony2 throwing error.

anyone knows how rid of it?

you create request this:

$request = request::create('http://example.com/path'); 

that make http host set.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -