Permalink
Browse files

Remove use of deprecated constants.

Fixes #2232
  • Loading branch information...
1 parent a098ff2 commit 525efcb8087ca46c24d9bdba2a1043d676ca2bc6 @markstory markstory committed Oct 29, 2013
Showing with 4 additions and 3 deletions.
  1. +1 −1 lib/Cake/Test/Case/View/Helper/JsHelperTest.php
  2. +3 −2 lib/Cake/View/Helper/JsHelper.php
@@ -367,7 +367,7 @@ public function testWriteBufferAndXhr() {
* @return void
*/
public function testWriteScriptsInFile() {
- $this->skipIf(!is_writable(JS), 'webroot/js is not Writable, script caching test has been skipped.');
+ $this->skipIf(!is_writable(WWW_ROOT . 'js'), 'webroot/js is not Writable, script caching test has been skipped.');
Configure::write('Cache.disable', false);
$this->Js->request->webroot = '/';
@@ -211,8 +211,9 @@ public function writeBuffer($options = array()) {
if ($options['cache'] && $options['inline']) {
$filename = md5($script);
- if (file_exists(JS . $filename . '.js')
- || cache(str_replace(WWW_ROOT, '', JS) . $filename . '.js', $script, '+999 days', 'public')
+ $path = WWW_ROOT . Configure::read('App.jsBaseUrl');
+ if (file_exists($path . $filename . '.js')
+ || cache(str_replace(WWW_ROOT, '', $path) . $filename . '.js', $script, '+999 days', 'public')
) {
return $this->Html->script($filename);
}

0 comments on commit 525efcb

Please sign in to comment.