本文整理匯總了PHP中Prophecy\Prophecy\ObjectProphecy::listShortUrls方法的典型用法代碼示例。如果您正苦於以下問題:PHP ObjectProphecy::listShortUrls方法的具體用法?PHP ObjectProphecy::listShortUrls怎麽用?PHP ObjectProphecy::listShortUrls使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Prophecy\Prophecy\ObjectProphecy
的用法示例。
在下文中一共展示了ObjectProphecy::listShortUrls方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: anExceptionsReturnsErrorResponse
/**
* @test
*/
public function anExceptionsReturnsErrorResponse()
{
$page = 3;
$this->service->listShortUrls($page, null, [], null)->willThrow(\Exception::class)->shouldBeCalledTimes(1);
$response = $this->action->__invoke(ServerRequestFactory::fromGlobals()->withQueryParams(['page' => $page]), new Response());
$this->assertEquals(500, $response->getStatusCode());
}
示例2: ifTagsFlagIsProvidedTagsColumnIsIncluded
/**
* @test
*/
public function ifTagsFlagIsProvidedTagsColumnIsIncluded()
{
$this->questionHelper->setInputStream($this->getInputStream('\\n'));
$this->shortUrlService->listShortUrls(1, null, [], null)->willReturn(new Paginator(new ArrayAdapter()))->shouldBeCalledTimes(1);
$this->commandTester->execute(['command' => 'shortcode:list', '--showTags' => true]);
$output = $this->commandTester->getDisplay();
$this->assertTrue(strpos($output, 'Tags') > 0);
}