【发布时间】:2014-12-10 15:27:56
【问题描述】:
我想知道是否有人对此错误有解决方案。我刚刚在 Symphony 2 项目中设置了 PhpUnit 4.3.* 和 Doctrine Fixtures Bundle,当我运行 bin/phpunit -c app/ 时出现以下错误。这些是由 Symfony 2 代码生成器自动生成的控制器测试,所以我认为嘿应该在任何情况下通过/有效。我有一种预感,我的 phpunit 配置/安装可能有问题,但我不确定...
Project\AdminBundle\Tests\Controller\DefaultControllerTest::testIndex
Undefined index: HTTP_HOST
郑重声明,我的composer.json 是:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"dms/dms-filter-bundle": "*",
"jms/i18n-routing-bundle": "1.1.*",
"jms/translation-bundle": "1.1.*",
"vmelnik/doctrine-encrypt-bundle": "dev-master",
"doctrine/doctrine-fixtures-bundle": "2.2.*"
},
"require-dev": {
"phpunit/phpunit": "4.3.*"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
【问题讨论】:
标签: php symfony phpunit symfony-2.3