【发布时间】:2014-06-29 15:21:08
【问题描述】:
我有一个测试
$response=$this->call('GET', '/');
$this->assertResponseOk();
当我运行 Symfony\Component\HttpKernel\Exception\NotFoundHttpException 时失败
phpunit
从项目目录中的命令行,我在项目目录中有 phpunit.xml(来自 laravel)
但是当我从 Netbeans 运行测试时 - 它通过了。
我将 Netbeans 输出命令复制到命令行
phpunit "C:\Program Files\NetBeans 8.0\php\phpunit\NetBeansSuite.php" "--run=C:\Program Files (x86)\wamp\www\platform\workbench\neyl\customers\tests;C:\Program Files (x86)\wamp\www\platform\app\tests"
它也有效!
因此,当从 NetbeansSuite.php 调用而不是从常规命令行调用时,测试有效。 甚至
phpunit MyTest.php
失败
怎么会这样?使用 PHPUnit_Framework_TestSuite 与普通 cli 有什么不同?
【问题讨论】:
-
这个问题可能是phpunit版本不同造成的。
-
如前所述,我正在通过 cli 调用路径中找到的 phpunit.bat 复制 Netbeans 测试套件,因此这两个测试肯定使用相同的版本!
标签: netbeans laravel-4 phpunit netbeans-8