From ca76136b935bd31171f61408b516478f88b40e04 Mon Sep 17 00:00:00 2001 From: Recca Tsai Date: Mon, 26 Mar 2018 16:18:39 +0800 Subject: [PATCH] get user directly from auth->user() --- tests/Panels/AuthPanelTest.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/Panels/AuthPanelTest.php b/tests/Panels/AuthPanelTest.php index edc4fa6..997db3f 100644 --- a/tests/Panels/AuthPanelTest.php +++ b/tests/Panels/AuthPanelTest.php @@ -25,14 +25,10 @@ public function testRenderFromGuard() $laravel->shouldReceive('offsetExists')->once()->with('sentinel')->andReturn(false); - $laravel->shouldReceive('offsetGet')->once()->with('session')->andReturn( - $sessionManager = m::mock('Illuminate\Session\SessionManager') - ); $laravel->shouldReceive('offsetGet')->once()->with('auth')->andReturn( $auth = m::mock('Illuminate\Contracts\Auth\Guard') ); - $auth->shouldReceive('getName')->once()->andReturn($name = 'foo'); - $sessionManager->shouldReceive('has')->once()->with($name)->andReturn(true); + $auth->shouldReceive('user')->once()->andReturn( $user = m::mock('stdClass') );