当前位置: 首页>>代码示例>>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;未经允许,请勿转载。