This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 157983

Summary: PHPUnit: Can not create test
Product: php Reporter: mkocian <mkocian>
Component: PHPUnitAssignee: Tomas Mysik <tmysik>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description mkocian 2009-02-05 12:29:02 UTC
Reproduce code:
<?php
class Foo extends Bar {
public function neco(){}
}
?>

Tools -> Create PHPUnit tests

Result: Warrning
Test were not generated for the following files:
foo.php
In output:
Fatal error: Class 'Bar' not found in /var/www/ .... /foo.php on line 2

(class 'Bar' is loaded by autoloading)
Comment 1 Tomas Mysik 2009-02-11 17:14:39 UTC
Sorry, NetBeans can't help you here - NB just runs PHPUnit script and the error comes from it. Anyway, I don't think that PHPUnit can
fix it as well; maybe you could add a special code for "unit tests only" - something like:

---------- >% ----------
if (!function_exists("__autoload")) {
    // define your autoload function here or include Bar class directly
}
---------- >% ----------

I know it's more a hack but it should work.