문제

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?

도움이 되었습니까?

해결책

Ok. The discrepancy was caused by order tests were called. phpunit from cli uses testsuites from phpunit.xml but the netbeans tests don't use the phpunit.xml for testsuites so they were called in order netbeans was calling them

Now I have to work out what the order of testclasses is causing!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top