Skip to content

Commit

Permalink
Apply fixes from StyleCI (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysanthos authored Jan 11, 2020
1 parent 27574c8 commit ea7c7da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/AuthLoggingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function boot()
$this->publishes([
__DIR__.'/../config/auth-logging.php' => config_path('auth-logging.php'),
], 'config');

}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Jobs/LogAuthAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected function getEmail()
*/
protected function getPassword()
{
$value = $this->payload['password'];
$value = $this->payload['password'];
$maskedFields = config('auth-logging.mask', []);

return in_array('password', $maskedFields, true)
Expand Down
15 changes: 7 additions & 8 deletions tests/TestLogAuthActionJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class TestLogAuthActionJob extends TestCase
{

protected $credentials = ['email' => 'first@chrysanthos.dev', 'password' => 'password'];

public function test_that_it_stores_the_credentials_when_enabled()
Expand All @@ -32,7 +31,7 @@ public function test_that_it_does_not_store_the_credentials_when_disabled()

$this->credentials = [
'email' => 'second@chrysanthos.dev',
'password' => 'password'
'password' => 'password',
];

event(new Failed('web', $this->getUser(), $this->credentials));
Expand All @@ -48,14 +47,14 @@ public function test_that_it_masks_fields_successfully()

$this->credentials = [
'email' => 'second@chrysanthos.dev',
'password' => 'password'
'password' => 'password',
];

event(new Failed('web', $this->getUser(), $this->credentials));

$this->assertDatabaseHas('auth_logs', [
'email' => '***ond@chrysanthos.dev',
'password' => '****word'
'password' => '****word',
]);
}

Expand All @@ -67,28 +66,28 @@ public function test_that_it_masks_selected_field_successfully()

$this->credentials = [
'email' => 'second@chrysanthos.dev',
'password' => 'password'
'password' => 'password',
];

event(new Failed('web', $this->getUser(), $this->credentials));

$this->assertDatabaseHas('auth_logs', [
'email' => 'second@chrysanthos.dev',
'password' => '****word'
'password' => '****word',
]);
}

protected function getUser()
{
return tap(new User, function ($user) {
$user->email = $this->credentials['email'];
$user->email = $this->credentials['email'];
$user->password = $this->credentials['password'];

return $user;
});
}

protected function migrate() : void
protected function migrate(): void
{
$this->loadLaravelMigrations();
$this->artisan('migrate')->run();
Expand Down

0 comments on commit ea7c7da

Please sign in to comment.