本文整理匯總了PHP中TestController::postReauthenticate方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestController::postReauthenticate方法的具體用法?PHP TestController::postReauthenticate怎麽用?PHP TestController::postReauthenticate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TestController
的用法示例。
在下文中一共展示了TestController::postReauthenticate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_post_reauthenticate_returns_redirect
public function test_post_reauthenticate_returns_redirect()
{
$user = new TestUser();
$user->password = bcrypt('test');
Auth::shouldReceive('user')->once()->andReturn($user);
Session::set('url.intended', 'http://reauthenticate.app/auth/reauthenticate');
$request = \Illuminate\Http\Request::create('http://reauthenticate.app/auth/reauthenticate', 'POST', ['password' => 'test']);
$request->setSession(app('session.store'));
$controller = new TestController();
/** @var Illuminate\Http\RedirectResponse $response */
$response = $controller->postReauthenticate($request);
$this->assertInstanceOf(Illuminate\Http\RedirectResponse::class, $response);
$this->assertEquals('http://reauthenticate.app/auth/reauthenticate', $response->getTargetUrl());
$this->assertTrue(Session::has('reauthenticate.life'));
$this->assertTrue(Session::has('reauthenticate.authenticated'));
$this->assertTrue(Session::get('reauthenticate.authenticated'));
}