當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。