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

Unit tests #61

Merged
merged 4 commits into from
Jul 25, 2014
Merged

Unit tests #61

merged 4 commits into from
Jul 25, 2014

Conversation

jbboehr
Copy link
Contributor

@jbboehr jbboehr commented Jul 22, 2014

I've written some basic unit tests, as I've been looking into using HHVM for some projects and wanted to verify basic operation.

For code coverage, I didn't cover excluding/not excluding media queries as it didn't seem to do anything either way. It seems like the CssSelector to XPath converter doesn't support media queries. The formatting changes to the specificity chunk loop were made because it was confusing the code coverage analyser. Aside from that, there is full superficial code coverage.

The library was fully compatible as-is with HHVM 3.1, except for an inconsistency in the uksort, so I made the sort function compatible. See facebook/hhvm#1781

@barryvdh
Copy link
Contributor

Cool :)
I refactored the specificity in #59 which should solve the HHVM issue, right? (And also improve some other points).

Once this and that one is merged, I'll also add some tests to the specificity functions.

I think the CssSelector skips mediaqueries, because it can't handle them anyways? You can't inline mediaqueries.

@barryvdh
Copy link
Contributor

I think you could also set bootstrap="vendor/autoload.php" in your phpunit.xml, so you don't need another bootstrap. The classes are autoloaded.

@jbboehr
Copy link
Contributor Author

jbboehr commented Jul 22, 2014

@barryvdh It makes sense to exclude media queries, I just wasn't sure if I was missing something as there's an option called excludeMediaQueries. You could potentially support inlining css within media queries based on a particular device profile.

tijsverkoyen added a commit that referenced this pull request Jul 25, 2014
@tijsverkoyen tijsverkoyen merged commit 4b693fa into tijsverkoyen:master Jul 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants