Commit 2e58729b authored by Viral Solani's avatar Viral Solani Committed by StyleCI Bot

Apply fixes from StyleCI

parent 6ec9c167
...@@ -27,8 +27,8 @@ class StoreRoleRequest extends Request ...@@ -27,8 +27,8 @@ class StoreRoleRequest extends Request
public function rules() public function rules()
{ {
$permissions = ''; $permissions = '';
if($this->associated_permissions != 'all') { if ($this->associated_permissions != 'all') {
$permissions = 'required'; $permissions = 'required';
} }
...@@ -41,7 +41,7 @@ class StoreRoleRequest extends Request ...@@ -41,7 +41,7 @@ class StoreRoleRequest extends Request
public function messages() public function messages()
{ {
return [ return [
'permissions.required' => 'You must select at least one permission for this role.' 'permissions.required' => 'You must select at least one permission for this role.',
]; ];
} }
} }
...@@ -27,8 +27,8 @@ class UpdateRoleRequest extends Request ...@@ -27,8 +27,8 @@ class UpdateRoleRequest extends Request
public function rules() public function rules()
{ {
$permissions = ''; $permissions = '';
if($this->associated_permissions != 'all') { if ($this->associated_permissions != 'all') {
$permissions = 'required'; $permissions = 'required';
} }
...@@ -41,7 +41,7 @@ class UpdateRoleRequest extends Request ...@@ -41,7 +41,7 @@ class UpdateRoleRequest extends Request
public function messages() public function messages()
{ {
return [ return [
'permissions.required' => 'You must select at least one permission for this role.' 'permissions.required' => 'You must select at least one permission for this role.',
]; ];
} }
} }
...@@ -58,7 +58,7 @@ $factory->define(Role::class, function (Generator $faker) { ...@@ -58,7 +58,7 @@ $factory->define(Role::class, function (Generator $faker) {
return [ return [
'name' => $faker->name, 'name' => $faker->name,
'all' => 0, 'all' => 0,
'sort' => $faker->numberBetween(1, 100) 'sort' => $faker->numberBetween(1, 100),
]; ];
}); });
......
...@@ -12,7 +12,7 @@ class AccessRepositoryTest extends BrowserKitTestCase ...@@ -12,7 +12,7 @@ class AccessRepositoryTest extends BrowserKitTestCase
$results = app()->make(\App\Repositories\Backend\Access\User\UserRepository::class) $results = app()->make(\App\Repositories\Backend\Access\User\UserRepository::class)
->getByPermission('view-backend') ->getByPermission('view-backend')
->toArray(); ->toArray();
$this->assertCount(1, $results); $this->assertCount(1, $results);
$this->assertArraySubset(['first_name' => $this->executive->first_name], $results[0]); $this->assertArraySubset(['first_name' => $this->executive->first_name], $results[0]);
$this->assertArraySubset(['last_name' => $this->executive->last_name], $results[0]); $this->assertArraySubset(['last_name' => $this->executive->last_name], $results[0]);
......
<?php <?php
use Tests\BrowserKitTestCase;
use App\Models\Access\Permission\Permission; use App\Models\Access\Permission\Permission;
use Tests\BrowserKitTestCase;
class RolePermissionTest extends BrowserKitTestCase class RolePermissionTest extends BrowserKitTestCase
{ {
......
<?php <?php
use Tests\BrowserKitTestCase;
use App\Models\Access\Role\Role;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
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\Models\Access\Role\Role;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Tests\BrowserKitTestCase;
/** /**
* Class RoleFormTest. * Class RoleFormTest.
...@@ -157,11 +157,11 @@ class RoleFormTest extends BrowserKitTestCase ...@@ -157,11 +157,11 @@ class RoleFormTest extends BrowserKitTestCase
Event::fake(); Event::fake();
$this->actingAs($this->admin); $this->actingAs($this->admin);
$role = factory(Role::class)->create([ $role = factory(Role::class)->create([
'created_by' => $this->admin->id 'created_by' => $this->admin->id,
]); ]);
$this->seeInDatabase(config('access.roles_table'), ['id' => $role->id]) $this->seeInDatabase(config('access.roles_table'), ['id' => $role->id])
->delete(route('admin.access.role.destroy', $role)) ->delete(route('admin.access.role.destroy', $role))
->assertRedirectedTo(route('admin.access.role.index')) ->assertRedirectedTo(route('admin.access.role.index'))
......
<?php <?php
use Tests\BrowserKitTestCase;
use App\Models\Access\User\User;
use Illuminate\Support\Facades\Event;
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\UserPasswordChanged; use App\Events\Backend\Access\User\UserPasswordChanged;
use App\Events\Backend\Access\User\UserUpdated;
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\BrowserKitTestCase;
/** /**
* Class UserFormTest. * Class UserFormTest.
...@@ -53,7 +53,7 @@ class UserFormTest extends BrowserKitTestCase ...@@ -53,7 +53,7 @@ class UserFormTest extends BrowserKitTestCase
$faker = Faker\Factory::create(); $faker = Faker\Factory::create();
$name = $faker->name; $name = $faker->name;
$email = $faker->safeEmail; $email = $faker->safeEmail;
$password = "Admin@123"; $password = 'Admin@123';
$this->actingAs($this->admin) $this->actingAs($this->admin)
->visit('/admin/access/user/create') ->visit('/admin/access/user/create')
......
<?php <?php
use Tests\BrowserKitTestCase;
use App\Models\Access\User\User; use App\Models\Access\User\User;
use Tests\BrowserKitTestCase;
/** /**
* Class HistoryRenderEntityTest. * Class HistoryRenderEntityTest.
......
<?php <?php
use Carbon\Carbon;
use Tests\BrowserKitTestCase;
use Illuminate\Support\Facades\Event;
use App\Events\Backend\Access\User\UserRestored;
use App\Events\Backend\Access\User\UserDeactivated; use App\Events\Backend\Access\User\UserDeactivated;
use App\Events\Backend\Access\User\UserReactivated;
use App\Events\Backend\Access\User\UserPermanentlyDeleted; use App\Events\Backend\Access\User\UserPermanentlyDeleted;
use App\Events\Backend\Access\User\UserReactivated;
use App\Events\Backend\Access\User\UserRestored;
use App\Notifications\Frontend\Auth\UserNeedsConfirmation; use App\Notifications\Frontend\Auth\UserNeedsConfirmation;
use Carbon\Carbon;
use Illuminate\Support\Facades\Event;
use Tests\BrowserKitTestCase;
/** /**
* Class UserRouteTest. * Class UserRouteTest.
......
...@@ -9,6 +9,6 @@ class DashboardRouteTest extends BrowserKitTestCase ...@@ -9,6 +9,6 @@ class DashboardRouteTest extends BrowserKitTestCase
{ {
public function testAdminDashboard() public function testAdminDashboard()
{ {
$this->actingAs($this->admin)->visit('/admin/dashboard')->see('Access Management')->see($this->admin->name); $this->actingAs($this->admin)->visit('/admin/dashboard')->see('Access Management')->see($this->admin->name);
} }
} }
\ No newline at end of file
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
namespace Tests; namespace Tests;
use App\Models\Access\User\User;
use App\Models\Access\Role\Role; use App\Models\Access\Role\Role;
use Illuminate\Support\Facades\DB; use App\Models\Access\User\User;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Laravel\BrowserKitTesting\TestCase as BaseTestCase; use Laravel\BrowserKitTesting\TestCase as BaseTestCase;
abstract class BrowserKitTestCase extends BaseTestCase abstract class BrowserKitTestCase extends BaseTestCase
......
...@@ -29,7 +29,7 @@ class AuthTest extends BrowserKitTestCase ...@@ -29,7 +29,7 @@ class AuthTest extends BrowserKitTestCase
/** @test */ /** @test */
public function test_login_failure_with_wrong_inputs() public function test_login_failure_with_wrong_inputs()
{ {
$this->visit("/login") $this->visit('/login')
->type('wrongusername@wrongpassword.com', 'email') ->type('wrongusername@wrongpassword.com', 'email')
->type('wrongpassword', 'password') ->type('wrongpassword', 'password')
->press('Login') ->press('Login')
......
...@@ -10,7 +10,7 @@ abstract class TestCase extends BaseTestCase ...@@ -10,7 +10,7 @@ abstract class TestCase extends BaseTestCase
public function signIn($user = null) public function signIn($user = null)
{ {
$user = $user ?: create('App\User'); $user = $user ?: create('App\User');
$this->be($user); $this->be($user);
......
...@@ -8,4 +8,4 @@ function create($class, $attributes = [], $times = null) ...@@ -8,4 +8,4 @@ function create($class, $attributes = [], $times = null)
function make($class, $attributes = [], $times = null) function make($class, $attributes = [], $times = null)
{ {
return factory($class, $times)->make($attributes); return factory($class, $times)->make($attributes);
} }
\ No newline at end of file
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