【发布时间】:2012-09-17 14:04:36
【问题描述】:
我安装了 phpunit 3.6.12 和 Silex。在我的应用程序的根目录中,我有测试目录,其中包含简单的测试文件 BlogFunctionTest.php
<?
use Silex\WebTestCase;
// BLOG: Front end test
class BlogFunctionalTest extends Silex\WebTestCase
{
public function testIndex()
{
$this->assertGreaterThan(0, 1);
}
}
?>
当我从命令行运行 phpunit 时出现错误
PHP Fatal error: Class 'Silex\WebTestCase' not found in {path}/BlogFunctionTest.php line 7
指的是我尝试扩展 WebTestCase 的那一行。如果我替换
,也会发生同样的情况use Silex\WebTestCase;
与
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
Silex 相对于我的测试文件安装在
../vendor/silex/
非常感谢任何提示,谢谢!
【问题讨论】: