當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。