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
2e58729b
Commit
2e58729b
authored
Dec 24, 2017
by
Viral Solani
Committed by
StyleCI Bot
Dec 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply fixes from StyleCI
parent
6ec9c167
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
36 additions
and
36 deletions
+36
-36
StoreRoleRequest.php
app/Http/Requests/Backend/Access/Role/StoreRoleRequest.php
+3
-3
UpdateRoleRequest.php
app/Http/Requests/Backend/Access/Role/UpdateRoleRequest.php
+3
-3
ModelFactory.php
database/factories/ModelFactory.php
+1
-1
AccessRepositoryTest.php
tests/Backend/Access/AccessRepositoryTest.php
+1
-1
RolePermissionTest.php
tests/Backend/Access/Role/RolePermissionTest.php
+1
-1
RoleFormTest.php
tests/Backend/Forms/Access/RoleFormTest.php
+7
-7
UserFormTest.php
tests/Backend/Forms/Access/UserFormTest.php
+6
-6
HistoryRenderEntityTest.php
tests/Backend/History/HistoryRenderEntityTest.php
+1
-1
UserRouteTest.php
tests/Backend/Routes/Access/UserRouteTest.php
+5
-5
DashboardRouteTest.php
tests/Backend/Routes/DashboardRouteTest.php
+2
-2
BrowserKitTestCase.php
tests/BrowserKitTestCase.php
+3
-3
AuthTest.php
tests/Feature/AuthTest.php
+1
-1
TestCase.php
tests/TestCase.php
+1
-1
helpers.php
tests/Utilities/helpers.php
+1
-1
No files found.
app/Http/Requests/Backend/Access/Role/StoreRoleRequest.php
View file @
2e58729b
...
...
@@ -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.'
,
];
}
}
app/Http/Requests/Backend/Access/Role/UpdateRoleRequest.php
View file @
2e58729b
...
...
@@ -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.'
,
];
}
}
database/factories/ModelFactory.php
View file @
2e58729b
...
...
@@ -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
)
,
];
});
...
...
tests/Backend/Access/AccessRepositoryTest.php
View file @
2e58729b
...
...
@@ -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
]);
...
...
tests/Backend/Access/Role/RolePermissionTest.php
View file @
2e58729b
<?php
use
Tests\BrowserKitTestCase
;
use
App\Models\Access\Permission\Permission
;
use
Tests\BrowserKitTestCase
;
class
RolePermissionTest
extends
BrowserKitTestCase
{
...
...
tests/Backend/Forms/Access/RoleFormTest.php
View file @
2e58729b
<?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'
))
...
...
tests/Backend/Forms/Access/UserFormTest.php
View file @
2e58729b
<?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'
)
...
...
tests/Backend/History/HistoryRenderEntityTest.php
View file @
2e58729b
<?php
use
Tests\BrowserKitTestCase
;
use
App\Models\Access\User\User
;
use
Tests\BrowserKitTestCase
;
/**
* Class HistoryRenderEntityTest.
...
...
tests/Backend/Routes/Access/UserRouteTest.php
View file @
2e58729b
<?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.
...
...
tests/Backend/Routes/DashboardRouteTest.php
View file @
2e58729b
...
...
@@ -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
}
tests/BrowserKitTestCase.php
View file @
2e58729b
...
...
@@ -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
...
...
tests/Feature/AuthTest.php
View file @
2e58729b
...
...
@@ -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'
)
...
...
tests/TestCase.php
View file @
2e58729b
...
...
@@ -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
);
...
...
tests/Utilities/helpers.php
View file @
2e58729b
...
...
@@ -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
}
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