-
Notifications
You must be signed in to change notification settings - Fork 123
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
Refactor PHPUnit bootstrap #96
Conversation
This can be used as a template for Parsedown extensions (like Parsedown Extra) to reuse Parsedown's original tests. You can either extend tests (like ParsedownExtraTest) or reuse them unchanged (like CommonMarkTest). Parsedown extensions simply have to implement their own TestParsedown class (test/TestParsedown.php) and all original tests will run with a instance of this class, rather than a instance of the original Parsedown class. This PR is a follow-up to erusev/parsedown#423, i.e. you must merge erusev/parsedown#423 first, otherwise this doesn't work.
This allows Parsedown extensions (like Parsedown Extra) to reuse existing Parsedown tests. See erusev/parsedown-extra#96 for details.
Failing tests don't break builds on purpose, Parsedown Extra doesn't fully comply with the CommonMark specs at the moment. We should switch to test/CommonMarkTest.php of erusev/parsedown later, see erusev/parsedown#423 for details.
.travis.yml
Outdated
- 5.6 | ||
- 5.5 | ||
- 5.4 | ||
- 5.3 | ||
- nightly | ||
- hhvm | ||
- hhvm-nightly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hhvm-nightly is not supported by travis anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... what is just temporary until Travis updates its infrastructure - something that will happen sooner rather than later, Ubuntu Precise's end-of-life is in about 6 months.
a5ea358
to
0fbc751
Compare
.travis.yml
Outdated
fast_finish: true | ||
allow_failures: | ||
- php: nightly | ||
- php: hhvm-nightly | ||
|
||
install: | ||
- composer install | ||
- composer install --prefer-dist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to prefer source here aidantwoods/SecureParsedown@3693641
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaaaah, and I was wondering why the files are missing 😆 Thanks!
All fixed now. However, the build still fails. It's IMO a good idea to merge #85 before merging this PR (just with a updated version constraint for
|
0fbc751
to
926e6f1
Compare
2375d76
to
926e6f1
Compare
Here's our latest build with Parsedown 1.7.1: https://travis-ci.org/erusev/parsedown-extra/builds/350738061 Naturally the two unrelated regressions are still there 😅 |
This can be used as a template for Parsedown extensions (like Parsedown Extra) to reuse Parsedown's original tests. You can either extend tests (e.g.
ParsedownExtraTest
extendsParsedownTest
) or reuse them unchanged (e.g.CommonMarkTest
). Parsedown extensions simply have to implement their ownTestParsedown
class (filetest/TestParsedown.php
) and all original tests will run with a instance of this class, rather than a instance of the originalParsedown
class.This PR is a follow-up to erusev/parsedown#423, i.e. you must merge erusev/parsedown#423 first, otherwise this doesn't work.
Here are the
phpunit
runs ofCommonMarkTest
andCommonMarkTestWeak
:$ phpunit -c phpunit.xml.dist vendor/erusev/parsedown/test/CommonMarkTest.php
Output: http://pastebin.com/ZVBjdmvK
$ phpunit -c phpunit.xml.dist vendor/erusev/parsedown/test/CommonMarkTestWeak.php
Output: http://pastebin.com/G4cBLfCT