Skip to content
Permalink
Browse files

Fixing delivery of plugin assets that reside in the root of a plugin …

…webroot directory. Tests added.
  • Loading branch information...
markstory committed Feb 17, 2010
1 parent e1eb827 commit 0b1efd3e86084dd65ab78e799d879e835cefe99f
@@ -617,7 +617,7 @@ function asset($url) {
if ($parts[0] === 'theme') {
$pos = strlen($parts[0] . $parts[1]) + 1;
} elseif (count($parts) > 2) {
} else {
$pos = strlen($parts[0]);
}
$assetFile = null;
@@ -1904,6 +1904,12 @@ function testAssets() {
$result = ob_get_clean();
$this->assertEqual('nested theme js file', $result);
ob_start();
$Dispatcher->asset('test_plugin/root.js');
$result = ob_get_clean();
$expected = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'root.js');
$this->assertEqual($result, $expected);
ob_start();
$Dispatcher->dispatch('test_plugin/flash/plugin_test.swf');
$result = ob_get_clean();
@@ -0,0 +1 @@
alert('I am a root level file!');

0 comments on commit 0b1efd3

Please sign in to comment.
You can’t perform that action at this time.