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


PHP Application::expects方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     $this->application = $this->getMock('Zend\\Mvc\\Application', array(), array(), '', false);
     $this->event = $this->getMock('Zend\\Mvc\\MvcEvent');
     $this->serviceManager = $this->getMock('Zend\\ServiceManager\\ServiceManager');
     $this->cli = $this->getMock('Symfony\\Component\\Console\\Application', array('run'));
     $this->serviceManager->expects($this->any())->method('get')->with('doctrine.cli')->will($this->returnValue($this->cli));
     $this->application->expects($this->any())->method('getServiceManager')->will($this->returnValue($this->serviceManager));
     $this->event->expects($this->any())->method('getTarget')->will($this->returnValue($this->application));
 }
开发者ID:shitikovkirill,项目名称:zend-shop.com,代码行数:10,代码来源:ModuleTest.php

示例2: setUp

 public function setUp()
 {
     $this->module = new Module();
     $this->app = $this->getMockBuilder('Zend\\Mvc\\Application')->disableOriginalConstructor()->getMock();
     $sm = new ServiceManager(new Config(['services' => ['translator' => Translator::factory(['locale' => 'id_ID'])]]));
     $this->app->expects($this->any())->method('getServiceManager')->willReturn($sm);
     $em = new EventManager();
     $em->setSharedManager(new SharedEventManager());
     $this->app->expects($this->any())->method('getEventManager')->willReturn($em);
 }
开发者ID:jkhaled,项目名称:LearnZF2,代码行数:10,代码来源:ModuleTest.php

示例3: setUpApplication

 private function setUpApplication()
 {
     $this->request = $this->getMockBuilder('Zend\\Http\\PhpEnvironment\\Request')->disableOriginalConstructor()->getMock();
     $this->response = $this->getMockBuilder('Zend\\Http\\PhpEnvironment\\Response')->disableOriginalConstructor()->getMock();
     $this->routeMatch = $this->getMockBuilder('Zend\\Mvc\\Router\\RouteMatch')->disableOriginalConstructor()->getMock();
     $this->mvcEvent = $this->getMockBuilder('Zend\\Mvc\\MvcEvent')->disableOriginalConstructor()->getMock();
     $this->mvcEvent->expects($this->any())->method('getRouteMatch')->will($this->returnValue($this->routeMatch));
     $this->application->expects($this->any())->method('getMvcEvent')->will($this->returnValue($this->mvcEvent));
     $this->application->expects($this->any())->method('getRequest')->will($this->returnValue($this->request));
     $this->application->expects($this->any())->method('getResponse')->will($this->returnValue($this->response));
 }
开发者ID:lafaiDev,项目名称:suive_com,代码行数:11,代码来源:RedirectCallbackTest.php


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