当前位置: 首页>>代码示例>>PHP>>正文


PHP Redirect::shouldReceive方法代码示例

本文整理汇总了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 () {
     }));
 }
开发者ID:kamaroly,项目名称:shift,代码行数:7,代码来源:AuthMiddlewareTest.php

示例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);
 }
开发者ID:sekouzed,项目名称:cabinet,代码行数:7,代码来源:LoginControllerTest.php

示例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 () {
     });
 }
开发者ID:kamaroly,项目名称:shift,代码行数:9,代码来源:AccountMiddlewareTest.php

示例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);
     }
 }
开发者ID:anahkiasen,项目名称:arrounded,代码行数:20,代码来源:BenchQueries.php


注:本文中的Illuminate\Support\Facades\Redirect::shouldReceive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。