本文整理汇总了PHP中Illuminate\Support\Facades\Redirect::shouldReceive方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::shouldReceive方法的具体用法?PHP Redirect::shouldReceive怎么用?PHP Redirect::shouldReceive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Redirect
的用法示例。
在下文中一共展示了Redirect::shouldReceive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGuestResponse
public function testGuestResponse()
{
$this->mockGuard->shouldReceive('guest')->once()->andReturn(true);
Redirect::shouldReceive('route')->with('home')->once()->andReturn('response');
$this->assertEquals('response', $this->middleware->handle($this->mockRequest, function () {
}));
}
示例2: testDestroy
public function testDestroy()
{
Auth::shouldReceive('logout')->once()->withNoArgs();
Redirect::shouldReceive('route')->once()->with('wardrobe.admin.login')->andReturn('cabinet');
$response = $this->action('GET', self::$wardrobeControllers . 'LoginController@destroy');
$this->assertSame('cabinet', $response->original);
}
示例3: testFilterWithNoActiveAccount
public function testFilterWithNoActiveAccount()
{
$mockRequest = m::spy('requestor');
CurrentAccount::shouldReceive('determine')->once()->andReturn(null);
$this->mockAccountManagementService->shouldReceive('totalNumberOfAccounts')->andReturn(0);
Redirect::shouldReceive('route')->with('install')->once();
$this->middleware->handle($mockRequest, function () {
});
}
示例4: getQueries
/**
* Get all queries by route.
*/
protected function getQueries()
{
$crawler = $this->getCrawler();
// Spoof Redirect::back
$endpoint = Redirect::home();
Redirect::shouldReceive('to')->andReturn($endpoint);
Redirect::shouldReceive('back')->andReturn($endpoint);
// Create Client
$this->laravel['auth']->loginUsingId($this->user);
$client = new Client($this->laravel, []);
// Crawl routes
$routes = $crawler->getRoutes();
$this->info('Found ' . count($routes) . ' routes');
foreach ($routes as $route) {
$this->inspect($client, $route);
}
}