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?

2
  • Maybe this issue occurs because of different versions of phpunit. May 13, 2014 at 5:36
  • As mentioned, I am replicating the Netbeans testsuite via cli calling the phpunit.bat found in my path so both tests are DEFINITELY using same version!
    – neyl
    May 13, 2014 at 5:49

1 Answer 1

0

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.