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
8817c374
Commit
8817c374
authored
Dec 22, 2017
by
Viral Solani
Committed by
StyleCI Bot
Dec 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply fixes from StyleCI
parent
01dbc4f5
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 @
8817c374
...
@@ -20,11 +20,11 @@ $factory->define(User::class, function (Generator $faker) {
...
@@ -20,11 +20,11 @@ $factory->define(User::class, function (Generator $faker) {
return
[
return
[
'first_name'
=>
$faker
->
name
,
'first_name'
=>
$faker
->
name
,
'last_name'
=>
$faker
->
name
,
'last_name'
=>
$faker
->
name
,
'email'
=>
$faker
->
safeEmail
,
'email'
=>
$faker
->
safeEmail
,
'password'
=>
$password
?:
$password
=
bcrypt
(
'secret'
),
'password'
=>
$password
?:
$password
=
bcrypt
(
'secret'
),
'confirmation_code'
=>
md5
(
uniqid
(
mt_rand
(),
true
)),
'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 () {
...
@@ -52,7 +52,6 @@ $factory->state(User::class, 'unconfirmed', function () {
];
];
});
});
/*
/*
* Roles
* Roles
*/
*/
...
...
tests/BrowserKitTestCase.php
View file @
8817c374
...
@@ -43,7 +43,7 @@ abstract class BrowserKitTestCase extends BaseTestCase
...
@@ -43,7 +43,7 @@ abstract class BrowserKitTestCase extends BaseTestCase
*/
*/
protected
$userRole
;
protected
$userRole
;
/**
/**
* Set up tests.
* Set up tests.
*/
*/
public
function
setUp
()
public
function
setUp
()
...
...
tests/Feature/AuthTest.php
View file @
8817c374
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
namespace
Tests\Feature
;
namespace
Tests\Feature
;
use
App\Events\Frontend\Auth\UserLoggedIn
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Auth
;
use
Tests\BrowserKitTestCase
;
use
Illuminate\Support\Facades\Event
;
use
Illuminate\Support\Facades\Event
;
use
App\Events\Frontend\Auth\UserLoggedIn
;
use
Tests\BrowserKitTestCase
;
class
AuthTest
extends
BrowserKitTestCase
class
AuthTest
extends
BrowserKitTestCase
{
{
...
@@ -44,22 +44,22 @@ class AuthTest extends BrowserKitTestCase
...
@@ -44,22 +44,22 @@ class AuthTest extends BrowserKitTestCase
public
function
users_can_login
()
public
function
users_can_login
()
{
{
// Make sure our events are fired
// Make sure our events are fired
Event
::
fake
();
Event
::
fake
();
Auth
::
logout
();
Auth
::
logout
();
//User Test
//User Test
$this
->
visit
(
'/login'
)
$this
->
visit
(
'/login'
)
->
type
(
$this
->
user
->
email
,
'email'
)
->
type
(
$this
->
user
->
email
,
'email'
)
->
type
(
'1234'
,
'password'
)
->
type
(
'1234'
,
'password'
)
->
press
(
'Login'
)
->
press
(
'Login'
)
->
see
(
$this
->
user
->
name
)
->
see
(
$this
->
user
->
name
)
->
seePageIs
(
'/dashboard'
);
->
seePageIs
(
'/dashboard'
);
Auth
::
logout
();
Auth
::
logout
();
//Admin Test
//Admin Test
$this
->
visit
(
'/login'
)
$this
->
visit
(
'/login'
)
->
type
(
$this
->
admin
->
email
,
'email'
)
->
type
(
$this
->
admin
->
email
,
'email'
)
->
type
(
'1234'
,
'password'
)
->
type
(
'1234'
,
'password'
)
->
press
(
'Login'
)
->
press
(
'Login'
)
...
@@ -67,6 +67,6 @@ class AuthTest extends BrowserKitTestCase
...
@@ -67,6 +67,6 @@ class AuthTest extends BrowserKitTestCase
->
see
(
$this
->
admin
->
first_name
)
->
see
(
$this
->
admin
->
first_name
)
->
see
(
'Access Management'
);
->
see
(
'Access Management'
);
Event
::
assertDispatched
(
UserLoggedIn
::
class
);
Event
::
assertDispatched
(
UserLoggedIn
::
class
);
}
}
}
}
tests/TestCase.php
View file @
8817c374
...
@@ -4,8 +4,8 @@ namespace Tests;
...
@@ -4,8 +4,8 @@ namespace Tests;
use
App\Models\Access\Role\Role
;
use
App\Models\Access\Role\Role
;
use
App\Models\Access\User\User
;
use
App\Models\Access\User\User
;
use
Illuminate\Support\Facades\Artisan
;
use
Illuminate\Foundation\Testing\TestCase
as
BaseTestCase
;
use
Illuminate\Foundation\Testing\TestCase
as
BaseTestCase
;
use
Illuminate\Support\Facades\Artisan
;
abstract
class
TestCase
extends
BaseTestCase
abstract
class
TestCase
extends
BaseTestCase
{
{
...
@@ -41,7 +41,7 @@ abstract class TestCase extends BaseTestCase
...
@@ -41,7 +41,7 @@ abstract class TestCase extends BaseTestCase
*/
*/
protected
$userRole
;
protected
$userRole
;
/**
/**
* Set up tests.
* Set up tests.
*/
*/
public
function
setUp
()
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