Unverified Commit 4b0a96a4 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #132 from viralsolani/analysis-zD0nZL

Apply fixes from StyleCI
parents cd88c0ac 190af1e8
...@@ -114,6 +114,7 @@ class RoleRepository extends BaseRepository ...@@ -114,6 +114,7 @@ class RoleRepository extends BaseRepository
return true; return true;
} }
throw new GeneralException(trans('exceptions.backend.access.roles.create_error')); throw new GeneralException(trans('exceptions.backend.access.roles.create_error'));
}); });
} }
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
namespace Tests\Feature\Backend; namespace Tests\Feature\Backend;
use Tests\TestCase;
use App\Models\Access\Role\Role;
use App\Exceptions\GeneralException;
use Illuminate\Support\Facades\Event;
use App\Models\Access\Permission\Permission;
use App\Events\Backend\Access\Role\RoleCreated; use App\Events\Backend\Access\Role\RoleCreated;
use App\Events\Backend\Access\Role\RoleDeleted; use App\Events\Backend\Access\Role\RoleDeleted;
use App\Events\Backend\Access\Role\RoleUpdated; use App\Events\Backend\Access\Role\RoleUpdated;
use App\Exceptions\GeneralException;
use App\Models\Access\Permission\Permission;
use App\Models\Access\Role\Role;
use Illuminate\Support\Facades\Event;
use Tests\TestCase;
class ManageRolesTest extends TestCase class ManageRolesTest extends TestCase
{ {
...@@ -75,7 +75,7 @@ class ManageRolesTest extends TestCase ...@@ -75,7 +75,7 @@ class ManageRolesTest extends TestCase
->assertSessionHas(['flash_success' => trans('alerts.backend.roles.created')]); ->assertSessionHas(['flash_success' => trans('alerts.backend.roles.created')]);
$this->assertDatabaseHas(config('access.roles_table'), [ $this->assertDatabaseHas(config('access.roles_table'), [
'name' => $role['name'] 'name' => $role['name'],
]); ]);
Event::assertDispatched(RoleCreated::class); Event::assertDispatched(RoleCreated::class);
...@@ -99,7 +99,7 @@ class ManageRolesTest extends TestCase ...@@ -99,7 +99,7 @@ class ManageRolesTest extends TestCase
->assertSessionHas(['flash_success' => trans('alerts.backend.roles.created')]); ->assertSessionHas(['flash_success' => trans('alerts.backend.roles.created')]);
$this->assertDatabaseHas(config('access.roles_table'), [ $this->assertDatabaseHas(config('access.roles_table'), [
'name' => $role['name'] 'name' => $role['name'],
]); ]);
$this->assertDatabaseHas(config('access.permissions_table'), ['name' => $permission->name]); $this->assertDatabaseHas(config('access.permissions_table'), ['name' => $permission->name]);
...@@ -144,7 +144,7 @@ class ManageRolesTest extends TestCase ...@@ -144,7 +144,7 @@ class ManageRolesTest extends TestCase
->assertSessionHas(['flash_success' => trans('alerts.backend.roles.updated')]); ->assertSessionHas(['flash_success' => trans('alerts.backend.roles.updated')]);
$this->assertDatabaseHas(config('access.roles_table'), [ $this->assertDatabaseHas(config('access.roles_table'), [
'name' => $data['name'] 'name' => $data['name'],
]); ]);
$this->assertDatabaseHas(config('access.permissions_table'), ['name' => $permission->name]); $this->assertDatabaseHas(config('access.permissions_table'), ['name' => $permission->name]);
......
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