sebastianbergmann/phpunit-skeleton-generator — Issue #8: Namespaces / autoloading?
Author: nataniel
Created: 2012-03-09 11:04:36+00:00
State: open

*src/Bar.php*
```php
phpunit-skelgen --test -- My\Bar src/Bar.php
PHPUnit Skeleton Generator 1.1.0 by Sebastian Bergmann.

PHP Fatal error: Class 'My\Some\Foo' not found in D:\Projects\TestProject\src\Bar.php on line 5
```

Skeleton Generator seems to parse the PHP file (and obviously, without autoloader, it cannot resolve its dependencies), when it should simply generate a test class for it. Netbeans developer says: "No bootstrap (autoload) is needed since phpunit-skelgen generates tests based on tokens (of source class) so it cannot fail with message "Cannot load class
XY"." (http://netbeans.org/bugzilla/show_bug.cgi?id=207627).

So now I'm not sure - is that Skeleton Generator problem or I should use bootstrap every time when running Skeleton Generator? (it works perfectly in that case).