Answer the question
In order to leave comments, you need to log in
codeception. phalcon. Undefined index: HTTP_HOST Bug?
Good afternoon.
The task is to cover the developed REST API with tests.
REST module settings:
url: http://127.0.0.1:8080/api/v1
depends: Phalcon
part: Json
$I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded');
$I->sendPOST('/client/add', ['name' => 'Vladimir', 'sex' => 'male']);
url: http://127.0.0.1:8080/api/v1
depends: PhpBrowser
part: Json
Answer the question
In order to leave comments, you need to log in
HTTP_HOST will not be defined since the tests are run from the command line.
You need to add an explicit definition to _bootstrap.php in the Codeception test directory:
$_SERVER['HTTP_HOST'] = 'MyHostName';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question