Unverified Commit 64b10c91 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #127 from viralsolani/analysis-XN0Kn1

Apply fixes from StyleCI
parents eed3f488 470cde32
...@@ -160,7 +160,7 @@ class UserRepository extends BaseRepository ...@@ -160,7 +160,7 @@ class UserRepository extends BaseRepository
} }
/** /**
* Change Password * Change Password.
* *
* @param $user * @param $user
* @param $input * @param $input
...@@ -174,11 +174,11 @@ class UserRepository extends BaseRepository ...@@ -174,11 +174,11 @@ class UserRepository extends BaseRepository
$user = $this->find(access()->id()); $user = $this->find(access()->id());
if (Hash::check($input['old_password'], $user->password)) { if (Hash::check($input['old_password'], $user->password)) {
$user->password = bcrypt($input['password']); $user->password = bcrypt($input['password']);
if ($user->save()) { if ($user->save()) {
event(new UserPasswordChanged($user)); event(new UserPasswordChanged($user));
return true; return true;
} }
......
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
namespace Tests\Feature\Backend; namespace Tests\Feature\Backend;
use Tests\TestCase;
use Illuminate\Support\Facades\Event;
use App\Events\Backend\Access\User\UserPasswordChanged; use App\Events\Backend\Access\User\UserPasswordChanged;
use Illuminate\Support\Facades\Event;
use Tests\TestCase;
class ChangePasswordTest extends TestCase class ChangePasswordTest extends TestCase
{ {
/** @test */ /** @test */
public function a_user_require_old_password_to_change_password() public function a_user_require_old_password_to_change_password()
{ {
......
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
namespace Tests\Feature\Backend; namespace Tests\Feature\Backend;
use Tests\TestCase;
use App\Models\Access\Role\Role;
use App\Models\Access\User\User;
use Illuminate\Support\Facades\Event;
use App\Models\Access\Permission\Permission;
use Illuminate\Support\Facades\Notification;
use App\Events\Backend\Access\User\UserCreated; use App\Events\Backend\Access\User\UserCreated;
use App\Events\Backend\Access\User\UserDeleted; use App\Events\Backend\Access\User\UserDeleted;
use App\Events\Backend\Access\User\UserUpdated; use App\Events\Backend\Access\User\UserUpdated;
use App\Models\Access\Permission\Permission;
use App\Models\Access\Role\Role;
use App\Models\Access\User\User;
use App\Notifications\Frontend\Auth\UserNeedsConfirmation; use App\Notifications\Frontend\Auth\UserNeedsConfirmation;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Notification;
use Tests\TestCase;
class ManageUsersTest extends TestCase class ManageUsersTest extends TestCase
{ {
...@@ -262,14 +262,13 @@ class ManageUsersTest extends TestCase ...@@ -262,14 +262,13 @@ class ManageUsersTest extends TestCase
->assertRedirect(route('admin.access.user.index')) ->assertRedirect(route('admin.access.user.index'))
->assertSessionHas(['flash_success' => trans('alerts.backend.users.updated')]); ->assertSessionHas(['flash_success' => trans('alerts.backend.users.updated')]);
$this->assertDatabaseHas(config('access.users_table'),[ $this->assertDatabaseHas(config('access.users_table'), [
'id' => $user->id, 'id' => $user->id,
'first_name' => $data['first_name'], 'first_name' => $data['first_name'],
'last_name' => $data['last_name'], 'last_name' => $data['last_name'],
]); ]);
Event::assertDispatched(UserUpdated::class); Event::assertDispatched(UserUpdated::class);
} }
/** @test */ /** @test */
...@@ -298,6 +297,7 @@ class ManageUsersTest extends TestCase ...@@ -298,6 +297,7 @@ class ManageUsersTest extends TestCase
$this->assertDatabaseHas(config('access.users_table'), ['id' => $this->admin->id, 'deleted_at' => null]); $this->assertDatabaseHas(config('access.users_table'), ['id' => $this->admin->id, 'deleted_at' => null]);
} }
// change password // change password
// export / import feature // export / import feature
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment