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 - PHPUnit: Can not create test
Summary: PHPUnit: Can not create test
Status: RESOLVED WONTFIX
Alias: None
Product: php
Classification: Unclassified
Component: PHPUnit (show other bugs)
Version: 6.x
Hardware: All Linux
: P3 blocker (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-05 12:29 UTC by mkocian
Modified: 2009-02-19 22:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.