我正在运行 Zf2 并且在我的控制器中有一行
$apiCaller = $_SERVER['REMOTE_ADDR'];
当我运行 PHPUnit 3.7.27 时,它会抛出以下错误,
There was 1 error:
1) MainTest\Controller\myControllerTest::testcreateActionCanBeAccessed
Undefined index: REMOTE_ADDR
/home/websites/mysite/module/Main/src/Main/Controller/myController.php:113
如何对这条线进行单元测试?