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


PHP FrontController::execute方法代码示例

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


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

示例1: testExecute

 /**
  * Configure ACL to deny everything, thus the request must be dispatched
  * to the authentication controller.
  * 
  * @covers spriebsch\MVC\FrontController
  */
 public function testExecute()
 {
     $this->request = $this->getMock('spriebsch\\MVC\\Request', array(), array(), '', false, false);
     $this->response = $this->getMock('spriebsch\\MVC\\Response', array(), array(), '', false, false);
     $this->session = $this->getMock('spriebsch\\MVC\\Session', array(), array(), '', false, false);
     $this->authAdapter = $this->getMock('spriebsch\\MVC\\AuthenticationAdapter', array(), array(), '', false, false);
     $this->controllerFactory = $this->getMock('spriebsch\\MVC\\ControllerFactory', array(), array(), '', false, false);
     $this->viewFactory = $this->getMock('spriebsch\\MVC\\ViewFactory', array(), array(), '', false, false);
     $this->acl = $this->getMock('spriebsch\\MVC\\Acl', array(), array(), '', false, false);
     $this->appController = $this->getMock('spriebsch\\MVC\\ApplicationController', array(), array(), '', false, false);
     $this->view = $this->getMock('spriebsch\\MVC\\View', array(), array(), '', false, false);
     $this->controller = $this->getMock('spriebsch\\MVC\\Controller', array(), array(), '', false, false);
     // Controller's execute method must be called once and return 'success'.
     $this->controller->expects($this->once())->method('execute')->will($this->returnValue('success'));
     // View's render method must be called once.
     $this->view->expects($this->once())->method('render');
     // ->with($this->equalTo());
     // @todo request and response as parameters
     // The controller factory returns the controller object.
     $this->controllerFactory->expects($this->once())->method('getController')->will($this->returnValue($this->controller));
     // The application controller returns a controller name, class, and
     // method that we ignore anyway.
     $this->appController->expects($this->once())->method('getControllerName')->will($this->returnValue('controller'));
     $this->appController->expects($this->once())->method('getClass')->will($this->returnValue('class'));
     $this->appController->expects($this->once())->method('getMethod')->will($this->returnValue('method'));
     $this->appController->expects($this->once())->method('getView')->will($this->returnValue($this->view));
     $fc = new FrontController($this->request, $this->response, $this->session, $this->authAdapter, $this->acl, $this->appController, $this->controllerFactory);
     $fc->execute();
 }
开发者ID:huanganxin,项目名称:MVC,代码行数:35,代码来源:FrontControllerTest.php

示例2: FrontController

<?php

error_reporting(E_ALL ^ E_STRICT);
require_once 'utility/Timer.php';
//Timer::start('Page Request');
require_once 'boot/bootstrap.php';
$f = new FrontController();
echo $f->execute();
//Timer::stop();
开发者ID:radicaldesigns,项目名称:gtd,代码行数:9,代码来源:index.php


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