當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PluginManager::expects方法代碼示例

本文整理匯總了PHP中Zend\Mvc\Controller\PluginManager::expects方法的典型用法代碼示例。如果您正苦於以下問題:PHP PluginManager::expects方法的具體用法?PHP PluginManager::expects怎麽用?PHP PluginManager::expects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Mvc\Controller\PluginManager的用法示例。


在下文中一共展示了PluginManager::expects方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testIndexActionWillRedirectToYuml

 /**
  * @covers \DoctrineORMModule\Yuml\YumlController::indexAction
  */
 public function testIndexActionWillRedirectToYuml()
 {
     $response = $this->getMock('Zend\\Http\\Response');
     $controllerResponse = $this->getMock('Zend\\Http\\Response');
     $redirect = $this->getMock('Zend\\Mvc\\Controller\\Plugin\\Redirect');
     $this->httpClient->expects($this->any())->method('send')->will($this->returnValue($response));
     $response->expects($this->any())->method('isSuccess')->will($this->returnValue(true));
     $response->expects($this->any())->method('getBody')->will($this->returnValue('short-url'));
     $this->pluginManager->expects($this->any())->method('get')->with('redirect')->will($this->returnValue($redirect));
     $redirect->expects($this->any())->method('toUrl')->with('http://yuml.me/short-url')->will($this->returnValue($controllerResponse));
     $this->assertSame($controllerResponse, $this->controller->indexAction());
 }
開發者ID:KBO-Techo-Dev,項目名稱:MagazinePro-zf25,代碼行數:15,代碼來源:YumlControllerTest.php

示例2: testIndexActionWillRedirectToYuml

 /**
  * @covers \OcraServiceManager\Controller\YumlController::indexAction
  */
 public function testIndexActionWillRedirectToYuml()
 {
     $this->serviceLocator->expects($this->any())->method('get')->with('Config')->will($this->returnValue(array('ocra_service_manager' => array('logged_service_manager' => true), 'zenddevelopertools' => array('toolbar' => array('enabled' => true)))));
     $client = $this->getMock('Zend\\Http\\Client');
     $response = $this->getMock('Zend\\Http\\Response');
     $controllerResponse = $this->getMock('Zend\\Http\\Response');
     $redirect = $this->getMock('Zend\\Mvc\\Controller\\Plugin\\Redirect');
     $client->expects($this->any())->method('send')->will($this->returnValue($response));
     $response->expects($this->any())->method('isSuccess')->will($this->returnValue(true));
     $response->expects($this->any())->method('getBody')->will($this->returnValue('short-url'));
     $this->pluginManager->expects($this->any())->method('get')->with('redirect')->will($this->returnValue($redirect));
     $redirect->expects($this->any())->method('toUrl')->with('http://yuml.me/short-url')->will($this->returnValue($controllerResponse));
     $this->controller->setHttpClient($client);
     $this->assertSame($controllerResponse, $this->controller->indexAction());
 }
開發者ID:rhodium289,項目名稱:sandbox,代碼行數:18,代碼來源:YumlControllerTest.php


注:本文中的Zend\Mvc\Controller\PluginManager::expects方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。