-
Notifications
You must be signed in to change notification settings - Fork 555
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
Test fixes #846
base: master
Are you sure you want to change the base?
Test fixes #846
Conversation
This class extends \Twig_SimpleFunction which is final since Twig v2. It was used only one time to be a proxy with default options. The class is not used anymore and the option was moved to the AssecitExtension.
jQuery seems to not appreciate the downloading: RuntimeException: Unable to load asset from URL "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"
@kriswallsmith @stof Tests are still failing with dev dependencies, but this job should be on allowed failure IMHO. WDYT? |
BTW, I can't reproduce on local. |
@@ -15,14 +15,14 @@ | |||
|
|||
class HttpAssetTest extends \PHPUnit_Framework_TestCase | |||
{ | |||
const JQUERY = 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'; |
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.
Maybe you should download it over https://
and then it will work?
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 the relation with /usr/bin/env: node: No such file or directory
error?
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 don't understand. I see mentioned error on failed build: https://travis-ci.org/kriswallsmith/assetic/jobs/203755333 , but probably it was failing before this PR as well.
$this->assertEquals('ajax/libs/jquery/1.6.1/jquery.min.js', $asset->getSourcePath(), '->__construct() set the source path'); | ||
$this->assertEquals('http://ajax.googleapis.com/ajax/libs/jquery/1.6.1', $asset->getSourceDirectory(), '->__construct() sets the source directory'); | ||
$asset = new HttpAsset(self::ASSET_URL); | ||
$this->assertEquals('https://maxcdn.bootstrapcdn.com', $asset->getSourceRoot(), '->__construct() set the source root'); |
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 recommend doing parse_url
on self::ASSET_URL
and then using what it returns in assertion. This way less duplication of url fragments in 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 prefer giving the raw value of what I need on assertions.
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 respect your coding style, but let's see maintainer opinion on this.
This has been implemented in the 2.0 branch of assetic-php/assetic. Until we tag 2.0, you can pull it in by using |
Each corrections are described on a separated commit.
WIP: I still have some errors on local but I want to check if it's the same with Travis.
Any help for remaining errors will be appreciated. 👍