Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #678 from jails/pr49

Close #674
  • Loading branch information...
commit 558a9f4df8018cdb9cd79457ff4dfa5962842c70 2 parents d8625c5 + 9fbb475
@gwoo gwoo authored
Showing with 11 additions and 7 deletions.
  1. +11 −7 tests/cases/net/http/MediaTest.php
View
18 tests/cases/net/http/MediaTest.php
@@ -151,29 +151,33 @@ public function testAssetAbsoluteRelativePaths() {
public function testCustomAssetUrls() {
$env = Environment::get();
+ $path = Libraries::get(true, 'path');
Libraries::add('cdn_js_test', array(
- 'path' => Libraries::get(true, 'path'),
+ 'path' => $path,
'assets' => array(
'js' => 'http://static.cdn.com'
- )
+ ),
+ 'bootstrap' => false
));
Libraries::add('cdn_env_test', array(
- 'path' => Libraries::get(true, 'path'),
+ 'path' => $path,
'assets' => array(
'js' => 'wrong',
$env => array('js' => 'http://static.cdn.com/myapp')
- )
+ ),
+ 'bootstrap' => false
));
+ $library = basename($path);
$result = Media::asset('foo', 'js', array('library' => 'cdn_js_test'));
- $this->assertEqual("http://static.cdn.com/lithium/js/foo.js", $result);
+ $this->assertEqual("http://static.cdn.com/{$library}/js/foo.js", $result);
$result = Media::asset('foo', 'css', array('library' => 'cdn_js_test'));
- $this->assertEqual("/lithium/css/foo.css", $result);
+ $this->assertEqual("/{$library}/css/foo.css", $result);
$result = Media::asset('foo', 'js', array('library' => 'cdn_env_test'));
- $this->assertEqual("http://static.cdn.com/myapp/lithium/js/foo.js", $result);
+ $this->assertEqual("http://static.cdn.com/myapp/{$library}/js/foo.js", $result);
Libraries::remove('cdn_env_test');
Libraries::remove('cdn_js_test');
Please sign in to comment.
Something went wrong with that request. Please try again.