![](/img/trans.png)
[英]PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found
[英]Symfony: Fatal error: Class 'PHPUnit_Framework_TestCase' not found in
使用Symfony 2.0,我有一个完整的系统在localhost中正常工作。
现在我已经尝试将其上传到互联网托管。 在遇到一些错误后,我被困在这里:
Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /home/preparatest/www/Symfony/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php
(顺便说一句,该类确实存在于该目录中)。
有谁通过这个?
注意:我没有特别配置PHPUnit 。 我想它只包含在一些Symfony包中。 我真的不知道它是什么,我不介意,如果可能的话,只是完全删除它。
更新:这是不起作用的确切类。 显然它没有找到父类\\PHPUnit_Framework_TestCase
。 但是,我坚持认为,这是一个捆绑在Symfony中的软件包,在本地运行良好。 我不明白为什么它不在远程:(
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Test;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\HttpKernelInterface;
/**
* WebTestCase is the base class for functional tests.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class WebTestCase extends \PHPUnit_Framework_TestCase
{
static protected $class;
static protected $kernel;
好的,解决了。
我从我的Bundles中删除了所有测试和测试文件夹。 那些只打算用Symfony进行单元测试的人......但我的产品显然没有安装PHPUnit。
非常感谢
通常不会将测试脚本放到生产服务器上。 但是如果你确实需要在那里运行测试,并且测试依赖于phpUnit(他们这样做),那么你需要在该服务器上安装phpUnit。 有关下载安装说明,请参见http://phpUnit.de/ 。
您显然已经在本地安装了phpUnit(无论您是否知道)。 也许它包含在你的PHP安装中,包含你正在使用的任何bundle / distro。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.