Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
813feb99
Unverified
Commit
813feb99
authored
Dec 28, 2017
by
Viral Solani
Committed by
GitHub
Dec 28, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #117 from viralsolani/analysis-Xk695R
Apply fixes from StyleCI
parents
ea9e06ea
2eee0c39
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
17 deletions
+18
-17
ModelFactory.php
database/factories/ModelFactory.php
+4
-3
2017_12_28_005822_add_null_constraint_on_created_by_on_role_table.php
...05822_add_null_constraint_on_created_by_on_role_table.php
+2
-2
2017_12_28_010952_add_null_constraint_on_created_by_on_permission_table.php
...add_null_constraint_on_created_by_on_permission_table.php
+2
-2
ManageUsersTest.php
tests/Feature/Backend/ManageUsersTest.php
+10
-10
No files found.
database/factories/ModelFactory.php
View file @
813feb99
<?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
),
];
});
database/migrations/2017_12_28_005822_add_null_constraint_on_created_by_on_role_table.php
View file @
813feb99
<?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
{
...
...
database/migrations/2017_12_28_010952_add_null_constraint_on_created_by_on_permission_table.php
View file @
813feb99
<?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
{
...
...
tests/Feature/Backend/ManageUsersTest.php
View file @
813feb99
...
...
@@ -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'
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment