在CakePHP中找不到PHPUnit_Util_Skeleton_Test [英] PHPUnit_Util_Skeleton_Test not found in CakePHP

查看:91
本文介绍了在CakePHP中找不到PHPUnit_Util_Skeleton_Test的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在名为Agg的插件中针对每个模型运行我的单独测试,但是当我尝试运行

I'm able to run my individual tests for each model in a plugin called Agg, but when I try to run a CakeTestSuite, then I get an error.

class ModelsTest extends CakeTestSuite
{
    public static function suite()
    {
        $suite = new CakeTestSuite('All model tests');
        $suite->addTestDirectory(TESTS . 'Case' . DS . 'Model');
        return $suite;
    }
}

运行该套件会产生此错误.

Running that suite generates this error.

致命错误:在第77行的C:\ work \ zend \ cake \ Cake \ TestSuite \ CakeTestSuiteCommand.php中找不到类'PHPUnit_Util_Skeleton_Test'

Fatal error: Class 'PHPUnit_Util_Skeleton_Test' not found in C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php on line 77

我正在使用PHP 5.3.15,并在CakePHP 2.2.5中安装了PHPUnit 3.7.12

I'm using PHP 5.3.15 and have PHPUnit 3.7.12 installed with CakePHP 2.2.5

在通过Web和CLI进行测试时出现此错误.

I get this error when running tests both via the web and the CLI.

任何帮助将不胜感激.

更新:

如果我在PEAR文件夹中搜索"PHPUnit_Util_Skeleton_Test"中的PHPUnit,则找不到该文件.这对我来说似乎很奇怪.我使用的是错误版本的PHPUnit吗?这堂课什么时候介绍的?

If I search for 'PHPUnit_Util_Skeleton_Test' in PEAR folder for PHPUnit it's not found. This seems strange to me. Am I using the wrong version of PHPUnit? When was this class introduced?

更新:

似乎该类不再在PHPUnit 3.7.x中使用,并且我想知道CakePHP 2.2是否仅适用于PHPUnit 3.6.我尝试卸载pear软件包,然后安装3.6.x版本,但始终安装最新版本.关于如何降级PHPUnit的任何想法?

It seems that this class is no longer used in PHPUnit 3.7.x, and I'm wondering if CakePHP 2.2 will only work with PHPUnit 3.6. I tried to uninstall the pear package, and then install the 3.6.x version but always installs the newest version. Any ideas on how to downgrade PHPUnit?

更新:

使用--force降级以安装旧版本的PHPUnit不能解决问题.我尝试了3.6.12、3.6.5和3.5.在3.6.12中,我在PHPUnit代码中的某个地方出现了is_file()错误.

Downgrading using the --force to install older versions of PHPUnit didn't resolve the problem. I tried 3.6.12, 3.6.5 and 3.5. With the 3.6.12 I got an error with is_file() somewhere in the PHPUnit code.

推荐答案

PHPUnit_Util_Skeleton_Test在PHPUnit 3.6中可用,请参见

PHPUnit_Util_Skeleton_Test is available in PHPUnit 3.6, see https://github.com/sebastianbergmann/phpunit/blob/3.6/PHPUnit/Util/Skeleton/Test.php

我建议卸载所有个phpunit软件包,并使用

I suggest uninstalling all phpunit packages and reinstalling phpunit 3.6 with

$ pear install phpunit/phpunit-3.6.12

--force降级单个phpunit软件包时,可能是依赖项被破坏了,这应该可以解决.

It might be that dependencies were broken when downgrading the single phpunit package with --force, and this should fix it.

这篇关于在CakePHP中找不到PHPUnit_Util_Skeleton_Test的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆