-
Notifications
You must be signed in to change notification settings - Fork 144
[TASK] Add more tests for parsing of invalid colors #359
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
Conversation
Hi! I wanted to showcase an issue but the tests aren't running automatically here. Does someone need to start them manually? if you want to reproduce locally, this script causes the warning on php 8+: <?php
use Sabberworm\CSS\Parser;
include 'vendor/autoload.php';
$oParser = new Parser("a { color: #fffff;}", Settings::create());
$oParser->parse(); |
This should be fixed by #485, though I'd like to include your additional tests... |
@oliverklee or @mathroc, can you rebase this please. I am just getting errors from d:\git_files\contribs\PHP-CSS-Parser>git rebase master
Current branch master is up to date.
d:\git_files\contribs\PHP-CSS-Parser>git checkout main
error: pathspec 'main' did not match any file(s) known to git
d:\git_files\contribs\PHP-CSS-Parser>git rebase origin/main
fatal: invalid upstream 'origin/main'
d:\git_files\contribs\PHP-CSS-Parser>git rebase main
fatal: invalid upstream 'main' |
GitHub doesn't allow them for first-time contributors until manually approved, as they have reportedly been used as a crypto-mining vector. I have a Hotmail account for which most genuine email is dunked in the 'Spam' folder, whereas actual spam is not. Draw your own conclusions. (Note that GitHub is owned by Microsoft, and as such, is not an open-source platform - it is merely a platform hosting open-souce software.) |
Hi! I'm not on my laptop so I sync'ed the branch with the GitHub UI (hence the merge commit) I can rebase it properly later if needed. still need a maintainer to approve running the unit tests |
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.
I sync'ed the branch with the GitHub UI (hence the merge commit) I can rebase it properly later if needed.
Thanks. The GitHub UI sync seems to have been sufficient. (I still don't know why I couldn't get the fork to rebase.)
I've now been able to confirm that these new tests would fail without the fix in #485, and pass with the fix in place.
I like the completeness of the test file, containing invalid color values with 1, 2, 4 and 5 characters.
Could you rename the test methods (to avoid the second one simply having the number 2
appeneded to the name)? And resolve the PHP-CS-Fixer error?
Thanks again.
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.
All looks good now. Thanks for contributing <3
We are getting warnings with some CSS code even on lenient mode on php 8.1 (but the same also happens on php 8.0)