0

I have single test

    $response=$this->call('GET', '/');
    $this->assertResponseOk();

that fails with Symfony\Component\HttpKernel\Exception\NotFoundHttpException when I run

phpunit

from commandline in project dir and I have phpunit.xml (from laravel) in project dir

BUT when I run tests from Netbeans - it passes.

I copied Netbeans output command to commandline

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"

and it also works!

So, test works when being called from NetbeansSuite.php but not from regular commandline. Even

phpunit MyTest.php

fails

How can this be? What factor is diiferent when using PHPUnit_Framework_TestSuite than regular cli?

4

1 回答 1

0

好的。差异是由调用订单测试引起的。来自 cli 的 phpunit 使用来自 phpunit.xml 的测试套件,但 netbeans 测试不使用 phpunit.xml 测试套件,因此它们被调用以 netbeans 调用它们的顺序

现在我必须弄清楚测试类的顺序导致了什么!

于 2014-05-13T06:12:19.863 回答