Unverified Commit 813feb99 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #117 from viralsolani/analysis-Xk695R

Apply fixes from StyleCI
parents ea9e06ea 2eee0c39
<?php
use Faker\Generator;
use App\Models\Access\Permission\Permission;
use App\Models\Access\Role\Role;
use App\Models\Access\User\User;
use App\Models\Access\Permission\Permission;
use Faker\Generator;
/*
|--------------------------------------------------------------------------
......@@ -76,9 +76,10 @@ $factory->state(Role::class, 'admin', function () {
$factory->define(Permission::class, function (Generator $faker) {
$name = $faker->word;
return [
'name' => $name,
'display_name' => $name,
'sort' => $faker->numberBetween(1, 100),
'sort' => $faker->numberBetween(1, 100),
];
});
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddNullConstraintOnCreatedByOnRoleTable extends Migration
{
......
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddNullConstraintOnCreatedByOnPermissionTable extends Migration
{
......
......@@ -2,10 +2,10 @@
namespace Tests\Feature\Backend;
use Tests\TestCase;
use App\Models\Access\Permission\Permission;
use App\Models\Access\Role\Role;
use App\Models\Access\User\User;
use App\Models\Access\Permission\Permission;
use Tests\TestCase;
class ManageUsersTest extends TestCase
{
......@@ -62,16 +62,16 @@ class ManageUsersTest extends TestCase
/** @test */
public function a_user_can_create_new_user()
{
$user = factory(User::class)->states('active','confirmed')->make()->toArray();
$role = create(Role::class);
$permission = create(Permission::class);
$user = factory(User::class)->states('active', 'confirmed')->make()->toArray();
$role = create(Role::class);
$permission = create(Permission::class);
$user['password'] = 'Viral@1234';
$user['password_confirmation'] = 'Viral@1234';
$user['assignees_roles'] = [$role->id];
$user['permissions'] = [$permission->id];
$user['password'] = 'Viral@1234';
$user['password_confirmation'] = 'Viral@1234';
$user['assignees_roles'] = [$role->id];
$user['permissions'] = [$permission->id];
$this->actingAs($this->admin)
$this->actingAs($this->admin)
->post(route('admin.access.user.store'), $user)
->assertRedirect(route('admin.access.user.index'));
......
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