I´m using Yii2 and Codeception to run tests.
When i run a functional test, the $SERVER['REMOTE_ADDR']
is not defined. How can i mockup the ip to use in those tests.
I have tried $SERVER['REMOTE_ADDR'] = '127.0.0.1'
, but it does not work.
common/
):
common/config/codeception-local.php
environments/dev/common/config/codeception-local.php
[
...
'on beforeAction' => static function () {
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
},
...
]