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

Test fixes #846

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

soullivaneuh
Copy link

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. 👍

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"
@soullivaneuh
Copy link
Author

@kriswallsmith @stof Tests are still failing with dev dependencies, but this job should be on allowed failure IMHO.

WDYT?

@soullivaneuh
Copy link
Author

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';
Copy link

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?

Copy link
Author

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?

Copy link

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');
Copy link

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.

Copy link
Author

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.

Copy link

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.

@LukeTowers
Copy link

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 "assetic/framework": "dev-2.0/dev" in your composer.json files.

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