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
487bec3c
Commit
487bec3c
authored
Dec 26, 2017
by
Viral Solani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test cases for frontend loggedout routes
parent
1059d6b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
111 additions
and
0 deletions
+111
-0
LoggedOutRouteTest.php
tests/Feature/Frontend/LoggedOutRouteTest.php
+111
-0
No files found.
tests/Feature/Frontend/LoggedOutRouteTest.php
0 → 100644
View file @
487bec3c
<?php
namespace
Tests\Feature\Frontend
;
use
Tests\BrowserKitTestCase
;
use
App\Models\Access\User\User
;
use
Illuminate\Support\Facades\App
;
use
Illuminate\Support\Facades\Event
;
use
App\Events\Frontend\Auth\UserConfirmed
;
use
Illuminate\Support\Facades\Notification
;
use
App\Notifications\Frontend\Auth\UserNeedsConfirmation
;
/**
* Class LoggedOutRouteTest.
*/
class
LoggedOutRouteTest
extends
BrowserKitTestCase
{
/**
* User Logged Out Frontend.
*/
/** @test */
public
function
test_homePage
()
{
$this
->
visit
(
'/'
)
->
assertResponseOk
();
}
/** @test */
public
function
test_macroPage
()
{
$this
->
visit
(
'/macros'
)
->
see
(
'Macro Examples'
);
}
/** @test */
public
function
testLoginPage
()
{
$this
->
visit
(
'/login'
)
->
see
(
'Login'
);
}
/** @test */
public
function
testRegisterPage
()
{
$this
->
visit
(
'/register'
)
->
see
(
'Register'
);
}
/** @test */
public
function
testForgotPasswordPage
()
{
$this
->
visit
(
'password/reset'
)
->
see
(
'Reset Password'
);
}
/** @test */
public
function
testDashboardPageLoggedOut
()
{
$this
->
visit
(
'/dashboard'
)
->
seePageIs
(
'/login'
);
}
/** @test */
public
function
testAccountPageLoggedOut
()
{
$this
->
visit
(
'/account'
)
->
seePageIs
(
'/login'
);
}
/**
* Create an unconfirmed user and assure the user gets
* confirmed when hitting the confirmation route.
*/
/** @test */
public
function
confirm_account_route
()
{
Event
::
fake
();
// Create default user to test with
$unconfirmed
=
factory
(
User
::
class
)
->
states
(
'unconfirmed'
)
->
create
();
$unconfirmed
->
attachRole
(
3
);
//User
$this
->
visit
(
'/account/confirm/'
.
$unconfirmed
->
confirmation_code
)
->
seePageIs
(
'/login'
)
->
see
(
'Your account has been successfully confirmed!'
)
->
seeInDatabase
(
config
(
'access.users_table'
),
[
'email'
=>
$unconfirmed
->
email
,
'confirmed'
=>
1
]);
Event
::
assertDispatched
(
UserConfirmed
::
class
);
}
/**
* Assure the user gets resent a confirmation email
* after hitting the resend confirmation route.
*/
/** @test */
public
function
resend_confirm_account_route
()
{
Notification
::
fake
();
$this
->
visit
(
'/account/confirm/resend/'
.
$this
->
user
->
id
)
->
seePageIs
(
'/login'
)
->
see
(
'A new confirmation e-mail has been sent to the address on file.'
);
Notification
::
assertSentTo
(
[
$this
->
user
],
UserNeedsConfirmation
::
class
);
}
/** @test */
public
function
test_404Page
()
{
$response
=
$this
->
call
(
'GET'
,
'7g48hwbfw9eufj'
);
$this
->
assertEquals
(
404
,
$response
->
getStatusCode
());
$this
->
assertContains
(
'Page Not Found'
,
$response
->
getContent
());
}
}
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