本文整理汇总了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());
}
示例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());
}