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!