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
cf420162
Unverified
Commit
cf420162
authored
Dec 22, 2017
by
Viral Solani
Committed by
GitHub
Dec 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #94 from viralsolani/analysis-8LDQ4w
Apply fixes from StyleCI
parents
01dbc4f5
8817c374
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
16 deletions
+15
-16
ModelFactory.php
database/factories/ModelFactory.php
+2
-3
BrowserKitTestCase.php
tests/BrowserKitTestCase.php
+1
-1
AuthTest.php
tests/Feature/AuthTest.php
+10
-10
TestCase.php
tests/TestCase.php
+2
-2
No files found.
database/factories/ModelFactory.php
View file @
cf420162
...
...
@@ -20,11 +20,11 @@ $factory->define(User::class, function (Generator $faker) {
return
[
'first_name'
=>
$faker
->
name
,
'last_name'
=>
$faker
->
name
,
'last_name'
=>
$faker
->
name
,
'email'
=>
$faker
->
safeEmail
,
'password'
=>
$password
?:
$password
=
bcrypt
(
'secret'
),
'confirmation_code'
=>
md5
(
uniqid
(
mt_rand
(),
true
)),
'remember_token'
=>
str_random
(
10
)
'remember_token'
=>
str_random
(
10
)
,
];
});
...
...
@@ -52,7 +52,6 @@ $factory->state(User::class, 'unconfirmed', function () {
];
});
/*
* Roles
*/
...
...
tests/BrowserKitTestCase.php
View file @
cf420162
...
...
@@ -43,7 +43,7 @@ abstract class BrowserKitTestCase extends BaseTestCase
*/
protected
$userRole
;
/**
/**
* Set up tests.
*/
public
function
setUp
()
...
...
tests/Feature/AuthTest.php
View file @
cf420162
...
...
@@ -2,10 +2,10 @@
namespace
Tests\Feature
;
use
App\Events\Frontend\Auth\UserLoggedIn
;
use
Illuminate\Support\Facades\Auth
;
use
Tests\BrowserKitTestCase
;
use
Illuminate\Support\Facades\Event
;
use
App\Events\Frontend\Auth\UserLoggedIn
;
use
Tests\BrowserKitTestCase
;
class
AuthTest
extends
BrowserKitTestCase
{
...
...
@@ -44,22 +44,22 @@ class AuthTest extends BrowserKitTestCase
public
function
users_can_login
()
{
// Make sure our events are fired
Event
::
fake
();
Event
::
fake
();
Auth
::
logout
();
Auth
::
logout
();
//User Test
$this
->
visit
(
'/login'
)
//User Test
$this
->
visit
(
'/login'
)
->
type
(
$this
->
user
->
email
,
'email'
)
->
type
(
'1234'
,
'password'
)
->
press
(
'Login'
)
->
see
(
$this
->
user
->
name
)
->
seePageIs
(
'/dashboard'
);
Auth
::
logout
();
Auth
::
logout
();
//Admin Test
$this
->
visit
(
'/login'
)
//Admin Test
$this
->
visit
(
'/login'
)
->
type
(
$this
->
admin
->
email
,
'email'
)
->
type
(
'1234'
,
'password'
)
->
press
(
'Login'
)
...
...
@@ -67,6 +67,6 @@ class AuthTest extends BrowserKitTestCase
->
see
(
$this
->
admin
->
first_name
)
->
see
(
'Access Management'
);
Event
::
assertDispatched
(
UserLoggedIn
::
class
);
Event
::
assertDispatched
(
UserLoggedIn
::
class
);
}
}
tests/TestCase.php
View file @
cf420162
...
...
@@ -4,8 +4,8 @@ namespace Tests;
use
App\Models\Access\Role\Role
;
use
App\Models\Access\User\User
;
use
Illuminate\Support\Facades\Artisan
;
use
Illuminate\Foundation\Testing\TestCase
as
BaseTestCase
;
use
Illuminate\Support\Facades\Artisan
;
abstract
class
TestCase
extends
BaseTestCase
{
...
...
@@ -41,7 +41,7 @@ abstract class TestCase extends BaseTestCase
*/
protected
$userRole
;
/**
/**
* Set up tests.
*/
public
function
setUp
()
...
...
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