From 4453c9122db55df71b2819789eb7d52d566a3ddf Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 14 May 2010 23:29:16 -0400 Subject: [PATCH] Fixing JsHelper test cases to use the request object. --- cake/tests/cases/libs/view/helpers/js.test.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 11dd0c955..3086ef4f1 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -83,10 +83,15 @@ class JsHelperTestCase extends CakeTestCase { $this->_asset = Configure::read('Asset.timestamp'); Configure::write('Asset.timestamp', false); + $request = new CakeRequest(null, false); + $this->Js = new JsHelper('JsBase'); + $this->Js->request = $request; $this->Js->Html = new HtmlHelper(); + $this->Js->Html->request = $request; $this->Js->Form = new FormHelper(); - $this->Js->Form->Html = new HtmlHelper(); + $this->Js->Form->request = $request; + $this->Js->Form->Html = $this->Js->Html; $this->Js->JsBaseEngine = new JsBaseEngineHelper(); $view = new JsHelperMockView(); @@ -111,10 +116,15 @@ class JsHelperTestCase extends CakeTestCase { * @return void */ function _useMock() { + $request = new CakeRequest(null, false); + $this->Js = new JsHelper(array('TestJs')); + $this->Js->request = $request; $this->Js->TestJsEngine = new TestJsEngineHelper($this); $this->Js->Html = new HtmlHelper(); + $this->Js->Html->request = $request; $this->Js->Form = new FormHelper(); + $this->Js->Form->request = $request; $this->Js->Form->Html = new HtmlHelper(); } @@ -278,6 +288,7 @@ class JsHelperTestCase extends CakeTestCase { if ($this->skipIf(!is_writable(JS), 'webroot/js is not Writable, script caching test has been skipped')) { return; } + $this->Js->request->webroot = '/'; $this->Js->JsBaseEngine = new TestJsEngineHelper(); $this->Js->buffer('one = 1;'); $this->Js->buffer('two = 2;');