-
Notifications
You must be signed in to change notification settings - Fork 790
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
Fixed broken Filter::XSSFilter() unit tests #854
Conversation
Excellent man, excellent It's so weird that these tests did basically nothing :) |
Yep ;) But unfortunately, the test does not pass. I will investigate. |
Aaah i think i found the bug :) The last test uses |
For my first contribution here, sorry to inconvenience :) Sorry, I could remove the using of In fact, you also noted the tests also failed with PHP 5.6., and be carrefull the raison they pass with PHP7. I am a quit new to PHPunit and travis (and even Github). After some tests in a dummy project https://github.com/Kristuff/dummyPHP, I have reproduced that error with all PHP versions (5.3 to 7.1 and hhvm) and fixed it by changing the test method like in last commit. Using of dedicaded method like The second issue (still not fixed) is the PHPUnit version used on travis. And concerning PHP 7 and 7.1. I already seen the issue. Travis currently uses the default version of PHPUnit compatible with PHP7, and it's now 6.0 . Tests class are not compatibles with the new namespace synthax. The log says 'No tests executed!' and it's why the tests pass! Note that it is also the case for all other tests of this project (I check another recent pull request). Currently, there is no tests executed of PHP7 at all. I think we need to force travis using the last compatible PHPUnit version (5.7.* which is supported on PHP 5.6, 7.0, 7.1). I will try to make the change soon. And by the way, thank you very much for this project. I learned a lot with it :) |
Great, it finally pass! :) |
Thanks! :) I've removed the weird StyleCI syntax check as it had strange results |
Hi,
The code coverage report is not generated for now because there is no white list defined. I have configured the white list in phpunit.xml configuration like this: <filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../application/core</directory>
<directory suffix=".php">../application/model</directory>
<directory suffix=".php">../application/controller</directory>
</whitelist>
</filter> You can see result here https://travis-ci.org/Kristuff/huge/jobs/225366327 |
Thanks a lot, awesome! I'm adding this to the project |
Your are welcome. To close the XssFilter chapter (I hope :)... ), I see an open issue #790 and a blocked PR #794 with [TODO] concerning a recursive implementation of XssFilter. I have implemented and fully tested the solution proposed here #790 (the method accepts now I can try to make another PR? My tests passed here https://travis-ci.org/Kristuff/huge/builds/225608242 |
Awesome!! Can you please make a PR, this would be super cool! Thanks a lot @kristuff |
done :) |
Currently,
testXSSFilterWithNonStringArguments()
method intests\core\FilterTest.php
does not test theXSSFilter()
method. Changed from:to: