Symfony2 netbeans 7.1.2和phpunit

Symfony2 netbeans 7.1.2和phpunit,symfony,phpunit,netbeans-7.1,Symfony,Phpunit,Netbeans 7.1,我正在努力让phpunit在我的symfony2项目的netbeans中工作 我已经在我的项目根目录中进行了子文件夹测试。尝试将项目链接到phpunit.xml.dist和bootstrap.php.cash。并在该测试文件夹中创建了一个MyProjectTestSuite.php,并将其也放在我的项目属性中 但这一切让我犯了一个错误: PHP Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message

我正在努力让phpunit在我的symfony2项目的netbeans中工作

我已经在我的项目根目录中进行了子文件夹测试。尝试将项目链接到phpunit.xml.dist和bootstrap.php.cash。并在该测试文件夹中创建了一个MyProjectTestSuite.php,并将其也放在我的项目属性中

但这一切让我犯了一个错误:

PHP Fatal error:  Uncaught exception 'PHPUnit_Framework_Exception' with message 'Could not find class "" in "C:\Program Files\NetBeans 7.1.2\php\phpunit\NetBeansSuite.php".' in C:\xampp\php\PEAR\PHPUnit\Util\Skeleton\Test.php:125
Stack trace:
#0 C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php(157): PHPUnit_Util_Skeleton_Test->__construct('', 'C:\Program File...')
#1 C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#2 C:\xampp\php\phpunit(53): PHPUnit_TextUI_Command::main()
#3 {main}
  thrown in C:\xampp\php\PEAR\PHPUnit\Util\Skeleton\Test.php on line 125

Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message 'Could not find class "" in "C:\Program Files\NetBeans 7.1.2\php\phpunit\NetBeansSuite.php".' in C:\xampp\php\PEAR\PHPUnit\Util\Skeleton\Test.php:125
Stack trace:
#0 C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php(157): PHPUnit_Util_Skeleton_Test->__construct('', 'C:\Program File...')
#1 C:\xampp\php\PEAR\PHPUnit\TextUI\Command.php(129): PHPUnit_TextUI_Command->run(Array, true)
#2 C:\xampp\php\phpunit(53): PHPUnit_TextUI_Command::main()
#3 {main}
  thrown in C:\xampp\php\PEAR\PHPUnit\Util\Skeleton\Test.php on line 125
而且测试不会被执行

myprojectetstsuite.php如下所示

<?php

use Symfony\Component\Finder\Finder;

class MyProjectTestSuite extends PHPUnit_Framework_TestSuite
{

    public static function suite()
    {
        $suite = new MyProjectTestSuite();
        $finder = new Finder();

        // ---------- COMMENT OUT TO TEST A SPECIFIC FILE ----------
        // $suite->addTestFile('../src/<yourbundle>/DefaultBundle/Tests/Controller/SomeControllerTest.php');
        // return $suite;
        // ----------

        echo "Searching for test cases...\n\n";
        foreach ($finder->files()->in('../src/')->name('*Test.php') as $file) {
            if (preg_match('%\\Tests\\[\w-\\]+Test.php%i', $file->getPathName())) {
                echo 'Adding test : ' . $file->getPathName() . "\n";
                $suite->addTestFile($file->getPathName());
            }
        }
        echo "\n";

        return $suite;
    }

}

好的。。如果测试套件找不到任何测试,netbeans将使用默认的测试套件。我对我的代码进行了一次调整,这样我确信我找到了一些测试(注释掉了regex),它们都在哪里

好的。。如果测试套件找不到任何测试,netbeans将使用默认的测试套件。我对我的代码进行了一次调整,这样我确信我找到了一些测试(注释掉了regex),它们都在哪里

是否尝试将phpunit.xml.dist复制到phpunit.xml,因为这是phpunit配置的默认文件?是否尝试将phpunit.xml.dist复制到phpunit.xml,因为这是phpunit配置的默认文件?