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