![](/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.