当前位置: 首页>>代码示例>>PHP>>正文


PHP CakeRequest::addPaths方法代码示例

本文整理汇总了PHP中CakeRequest::addPaths方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeRequest::addPaths方法的具体用法?PHP CakeRequest::addPaths怎么用?PHP CakeRequest::addPaths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CakeRequest的用法示例。


在下文中一共展示了CakeRequest::addPaths方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testAddPaths

 /**
  * Test splicing in paths.
  *
  * @return void
  */
 public function testAddPaths()
 {
     $request = new CakeRequest('some/path');
     $request->webroot = '/some/path/going/here/';
     $result = $request->addPaths(array('random' => '/something', 'webroot' => '/', 'here' => '/', 'base' => '/base_dir'));
     $this->assertSame($result, $request, 'Method did not return itself. %s');
     $this->assertEquals('/', $request->webroot);
     $this->assertEquals('/base_dir', $request->base);
     $this->assertEquals('/', $request->here);
     $this->assertFalse(isset($request->random));
 }
开发者ID:xMyThoLoGyx,项目名称:centremedicaletp3,代码行数:16,代码来源:CakeRequestTest.php

示例2: testAfterLayout

 /**
  * Test afterlayout element rendering
  *
  * @return void
  */
 public function testAfterLayout()
 {
     $this->Controller->viewPath = 'Posts';
     $request = new CakeRequest('/posts/index');
     $request->addParams(Router::parse($request->url));
     $request->addPaths(array('webroot' => '/', 'base' => '/', 'here' => '/posts/index'));
     $this->Controller->setRequest($request);
     $this->Controller->layout = 'default';
     $this->Controller->uses = null;
     $this->Controller->components = array('DebugKit.Toolbar');
     $this->Controller->constructClasses();
     $this->Controller->Components->trigger('startup', array($this->Controller));
     $this->Controller->Components->trigger('beforeRender', array($this->Controller));
     $result = $this->Controller->render();
     $this->assertNotRegExp('/debug-toolbar/', (string) $result);
     $result = $this->firecake->sentHeaders;
     $this->assertTrue(is_array($result));
 }
开发者ID:hupla78,项目名称:Nadia,代码行数:23,代码来源:FirePhpToolbarHelperTest.php

示例3: testJavascriptInjection

 /**
  * test injection of javascript
  *
  * @return void
  **/
 public function testJavascriptInjection()
 {
     $this->Controller->viewPath = 'posts';
     $this->Controller->uses = null;
     $request = new CakeRequest('/posts/index');
     $request->addParams(Router::parse($request->url));
     $request->addPaths(array('webroot' => '/', 'base' => '/', 'here' => '/posts/index'));
     $this->Controller->setRequest($request);
     $this->Controller->helpers = array('Js', 'Html', 'Session');
     $this->Controller->components = array('DebugKit.Toolbar');
     $this->Controller->layout = 'default';
     $this->Controller->constructClasses();
     $this->Controller->Components->trigger('startup', array($this->Controller));
     $this->Controller->Components->trigger('beforeRender', array($this->Controller));
     $result = $this->Controller->render();
     $result = str_replace(array("\n", "\r"), '', $result);
     $this->assertPattern('#<script\\s*type="text/javascript"\\s*src="/debug_kit/js/js_debug_toolbar.js(:?\\?\\d*?)?"\\s*>\\s?</script>#', $result);
 }
开发者ID:omusico,项目名称:RentSquare,代码行数:23,代码来源:HtmlToolbarHelperTest.php

示例4: testRenderTimers

 /**
  * test rendering and ensure that timers are being set.
  *
  * @return void
  */
 public function testRenderTimers()
 {
     $request = new CakeRequest('/posts/index');
     $request->addParams(Router::parse($request->url));
     $request->addPaths(array('webroot' => '/', 'base' => '/', 'here' => '/posts/index'));
     $this->Controller->setRequest($request);
     $this->Controller->viewPath = 'posts';
     $this->Controller->layout = 'default';
     $View = new DebugView($this->Controller, false);
     $View->render('index');
     $result = DebugKitDebugger::getTimers();
     $this->assertEqual(count($result), 4);
     $this->assertTrue(isset($result['viewRender']));
     $this->assertTrue(isset($result['render_default.ctp']));
     $this->assertTrue(isset($result['render_index.ctp']));
     $result = DebugKitDebugger::getMemoryPoints();
     $this->assertTrue(isset($result['View render complete']));
 }
开发者ID:omusico,项目名称:RentSquare,代码行数:23,代码来源:DebugViewTest.php


注:本文中的CakeRequest::addPaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。