Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically load the bootstrap file from phpunit? #28

Closed
Seldaek opened this issue Feb 20, 2013 · 4 comments
Closed

Automatically load the bootstrap file from phpunit? #28

Seldaek opened this issue Feb 20, 2013 · 4 comments

Comments

@Seldaek
Copy link

Seldaek commented Feb 20, 2013

When running the composer test suite with paratest, you have to give it --bootstrap=tests/bootstrap.php or it fails to load some abstract test classes properly, and results in this:

Fatal error: Class 'Composer\Test\TestCase' not found in C:\Users\seld\Web\composer\tests\Composer\Test\Autoload\AutoloadGeneratorTest.php on line 23

As you can see in the AutoloadGeneratorTest class extends the TestCase class. This class is made loadable via the composer autoloader in the bootstrap file, but paratest doesn't pick it up automatically it seems.

@brianium
Copy link
Contributor

Paratest should load the bootstrap from the phpunit.xml file, but currently it does not look for bootstrap.php. Is this just a matter of looking for a bootstrap.php file relative to where the command is executed?

@Seldaek
Copy link
Author

Seldaek commented Feb 20, 2013

No I am not saying this should be automated. As you can see in the phpunit config the bootstrap file is provided, and that works well when running the tests, but I think the issue is that paratest scans the files upfront and doesn't load the bootstrap file to do so, so it fails at loading the classes before it can even start phpunit.

@brianium
Copy link
Contributor

I think this part is flawed here. https://github.com/brianium/paratest/blob/master/src/ParaTest/Console/Testers/PHPUnit.php#L53 I think if bootstrap is in config, it is not being passed to the options array. That might explain why --bootstrap works when provided explicitly.

dbaltas added a commit to tripsta/paratest that referenced this issue Feb 27, 2013
pwarnes pushed a commit to pwarnes/paratest that referenced this issue Apr 7, 2013
…on - This addresses paratestphp#28. If a bootstrap is specified but cannot be found, a RuntimeException is now thrown.
@dbaltas
Copy link
Contributor

dbaltas commented May 17, 2013

@Seldaek, This issue is resolved after pull request #35. Thanks for the feedback.

@dbaltas dbaltas closed this as completed May 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants