diff --git a/src/Socialite/Controllers/Settings/ProfileController.php b/src/Socialite/Controllers/Settings/ProfileController.php index f03cf68..e78826b 100644 --- a/src/Socialite/Controllers/Settings/ProfileController.php +++ b/src/Socialite/Controllers/Settings/ProfileController.php @@ -33,8 +33,7 @@ public function edit() $social_login_providers = self::formatProviders(config('auth.social_login.providers'), request()); $linked_providers = SocialAccount::where('user_id', $user->id)->select(['provider'])->pluck('provider')->all(); return view('settings.profile', compact('user', 'social_login_providers', 'linked_providers') + - ['errors' => session('errors', new ViewErrorBag())] // HACK: only for test - ); + ['errors' => session('errors', new ViewErrorBag())]); // HACK: only for test } /** @@ -46,7 +45,7 @@ public function edit() public function update(Request $request) { $user = $request->user(); - $validated_data = Validator::make($request->all(), [ + Validator::make($request->all(), [ 'email' => [ Rule::unique('users')->ignore($user->id), ], diff --git a/tests/Feature/ProfileControllerTest.php b/tests/Feature/ProfileControllerTest.php index 737f083..25de808 100644 --- a/tests/Feature/ProfileControllerTest.php +++ b/tests/Feature/ProfileControllerTest.php @@ -32,7 +32,8 @@ public function testEditShouldHideWeChatWebWhenVisitFromWeChatApp() $response = $this->actingAs($user) ->withHeader( 'user-agent', - 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.5(0x17000523) NetType/WIFI Language/zh_CN' + 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)' . + ' Mobile/15E148 MicroMessenger/7.0.5(0x17000523) NetType/WIFI Language/zh_CN' )->get('/settings/profile'); $response->assertViewIs('settings.profile'); diff --git a/tests/Feature/SocialiteLoginControllerTest.php b/tests/Feature/SocialiteLoginControllerTest.php index c799b2c..f242a01 100644 --- a/tests/Feature/SocialiteLoginControllerTest.php +++ b/tests/Feature/SocialiteLoginControllerTest.php @@ -29,7 +29,8 @@ public function testHideWeChatWebWhenLoginFromWeChatApp() $this->app['config']->set('auth.social_login.providers', array_merge($providers, ['wechat_web'])); $response = $this->withHeader( 'user-agent', - 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.5(0x17000523) NetType/WIFI Language/zh_CN' + 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko)' . + ' Mobile/15E148 MicroMessenger/7.0.5(0x17000523) NetType/WIFI Language/zh_CN' )->get('/login'); $response->assertViewIs('auth.login');