-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'; | ||
const ASSET_URL = 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'; | ||
|
||
/** | ||
* @group http | ||
*/ | ||
public function testGetLastModified() | ||
{ | ||
$asset = new HttpAsset(self::JQUERY); | ||
$asset = new HttpAsset(self::ASSET_URL); | ||
$this->assertInternalType('integer', $asset->getLastModified(), '->getLastModified() returns an integer'); | ||
} | ||
|
||
|
@@ -31,7 +31,7 @@ public function testGetLastModified() | |
*/ | ||
public function testProtocolRelativeUrl() | ||
{ | ||
$asset = new HttpAsset(substr(self::JQUERY, 5)); | ||
$asset = new HttpAsset(substr(self::ASSET_URL, 6)); | ||
$asset->load(); | ||
$this->assertNotEmpty($asset->getContent()); | ||
} | ||
|
@@ -53,9 +53,9 @@ public function testInvalidUrl() | |
|
||
public function testSourceMetadata() | ||
{ | ||
$asset = new HttpAsset(self::JQUERY); | ||
$this->assertEquals('http://ajax.googleapis.com', $asset->getSourceRoot(), '->__construct() set the source root'); | ||
$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 commentThe reason will be displayed to describe this comment to others. Learn more. I recommend doing There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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->assertEquals('bootstrap/3.3.7/css/bootstrap.min.css', $asset->getSourcePath(), '->__construct() set the source path'); | ||
$this->assertEquals('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css', $asset->getSourceDirectory(), '->__construct() sets the source directory'); | ||
} | ||
} |
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.