本文整理匯總了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());
}