gpt4 book ai didi

php - Symfony: fatal error :找不到类 'PHPUnit_Framework_TestCase'

转载 作者:可可西里 更新时间:2023-11-01 00:34:25 25 4
gpt4 key购买 nike

使用 Symfony 2.0,我有一个在本地主机上正常工作的整个系统。

现在我尝试将其上传到 Internet 托管。在处理一些错误后,我被困在这里:

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;

最佳答案

好的,解决了。

我从我的 bundle 中删除了所有测试和测试文件夹。那些只是打算用 Symfony 执行单元测试的人......但我的作品显然没有安装 PHPUnit。

非常感谢

关于php - Symfony: fatal error :找不到类 'PHPUnit_Framework_TestCase',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12778829/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com