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
2a28e804
Commit
2a28e804
authored
Dec 28, 2017
by
Viral Solani
Committed by
StyleCI Bot
Dec 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply fixes from StyleCI
parent
8db1fd5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
UserRepository.php
app/Repositories/Backend/Access/User/UserRepository.php
+0
-1
ManageUsersTest.php
tests/Feature/Backend/ManageUsersTest.php
+14
-16
No files found.
app/Repositories/Backend/Access/User/UserRepository.php
View file @
2a28e804
...
...
@@ -97,7 +97,6 @@ class UserRepository extends BaseRepository
$user
=
$this
->
createUserStub
(
$data
);
DB
::
transaction
(
function
()
use
(
$user
,
$data
,
$roles
,
$permissions
)
{
if
(
$user
->
save
())
{
//User Created, Validate Roles
...
...
tests/Feature/Backend/ManageUsersTest.php
View file @
2a28e804
...
...
@@ -2,14 +2,14 @@
namespace
Tests\Feature\Backend
;
use
Tests\TestCase
;
use
App\Events\Backend\Access\User\UserCreated
;
use
App\Models\Access\Permission\Permission
;
use
App\Models\Access\Role\Role
;
use
App\Models\Access\User\User
;
use
App\Notifications\Frontend\Auth\UserNeedsConfirmation
;
use
Illuminate\Support\Facades\Event
;
use
Illuminate\Support\Facades\Notification
;
use
App\Models\Access\Permission\Permission
;
use
App\Events\Backend\Access\User\UserCreated
;
use
App\Notifications\Frontend\Auth\UserNeedsConfirmation
;
use
Tests\TestCase
;
class
ManageUsersTest
extends
TestCase
{
...
...
@@ -92,14 +92,13 @@ class ManageUsersTest extends TestCase
}
/** @test */
function
a_user_requires_a_confirm_password
()
public
function
a_user_requires_a_confirm_password
()
{
$user
=
factory
(
User
::
class
)
->
states
(
'active'
,
'confirmed'
)
->
make
()
->
toArray
();
$user
[
'password'
]
=
'Viral@1234'
;
$user
[
'password_confirmation'
]
=
'Viral@1235'
;
$this
->
withExceptionHandling
()
->
actingAs
(
$this
->
admin
)
->
post
(
route
(
'admin.access.user.store'
),
$user
)
...
...
@@ -107,7 +106,6 @@ class ManageUsersTest extends TestCase
}
/** @test */
public
function
a_user_requires_a_role
()
{
$this
->
createUser
()
...
...
@@ -143,10 +141,10 @@ class ManageUsersTest extends TestCase
$this
->
assertDatabaseHas
(
config
(
'access.users_table'
),
[
'first_name'
=>
$user
[
'first_name'
],
'last_name'
=>
$user
[
'last_name'
],
'email'
=>
$user
[
'email'
],
'status'
=>
1
,
'confirmed'
=>
1
,
'last_name'
=>
$user
[
'last_name'
],
'email'
=>
$user
[
'email'
],
'status'
=>
1
,
'confirmed'
=>
1
,
]);
$this
->
assertDatabaseHas
(
config
(
'access.roles_table'
),
[
'name'
=>
$role
->
name
]);
$this
->
assertDatabaseHas
(
config
(
'access.permissions_table'
),
[
'name'
=>
$permission
->
name
]);
...
...
@@ -155,7 +153,7 @@ class ManageUsersTest extends TestCase
Event
::
assertDispatched
(
UserCreated
::
class
);
}
/** @test */
/** @test */
public
function
an_email_will_be_sent_to_uncomfirmed_user
()
{
// Make sure our events are fired
...
...
@@ -181,10 +179,10 @@ class ManageUsersTest extends TestCase
$this
->
assertDatabaseHas
(
config
(
'access.users_table'
),
[
'first_name'
=>
$user
[
'first_name'
],
'last_name'
=>
$user
[
'last_name'
],
'email'
=>
$user
[
'email'
],
'status'
=>
1
,
'confirmed'
=>
0
,
'last_name'
=>
$user
[
'last_name'
],
'email'
=>
$user
[
'email'
],
'status'
=>
1
,
'confirmed'
=>
0
,
]);
$this
->
assertDatabaseHas
(
config
(
'access.roles_table'
),
[
'name'
=>
$role
->
name
]);
$this
->
assertDatabaseHas
(
config
(
'access.permissions_table'
),
[
'name'
=>
$permission
->
name
]);
...
...
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