Skip to content

Commit

Permalink
fix: lint code. #33
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkcup committed Sep 10, 2019
1 parent 7bc2aeb commit bc47714
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Socialite/Controllers/Settings/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand All @@ -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),
],
Expand Down
3 changes: 2 additions & 1 deletion tests/Feature/ProfileControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 2 additions & 1 deletion tests/Feature/SocialiteLoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit bc47714

Please sign in to comment.