Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
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
Platform
Commits
95973ff0
Commit
95973ff0
authored
Oct 10, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renaming the user test and adding the session test
parent
2bbe2067
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
1 deletion
+64
-1
SessionUrlTest.php
Tests/SessionUrlTest.php
+63
-0
UserUrlTest.php
Tests/UserUrlTest.php
+1
-1
No files found.
Tests/SessionUrlTest.php
0 → 100644
View file @
95973ff0
<?php
namespace
Modules\User\Tests
;
use
Cartalyst\Sentinel\Laravel\Facades\Sentinel
;
use
TestCase
;
class
SessionUrlTest
extends
TestCase
{
/** @test */
public
function
loginPageShouldBeAccessible
()
{
$crawler
=
$this
->
client
->
request
(
'GET'
,
'/auth/login'
);
$this
->
assertTrue
(
$this
->
client
->
getResponse
()
->
isOk
());
$this
->
assertCount
(
1
,
$crawler
->
filter
(
'.header:contains("Sign In")'
));
}
/** @test */
public
function
registerPageShouldBeAccessible
()
{
$crawler
=
$this
->
client
->
request
(
'GET'
,
'/auth/register'
);
$this
->
assertTrue
(
$this
->
client
->
getResponse
()
->
isOk
());
$this
->
assertCount
(
1
,
$crawler
->
filter
(
'.header:contains("Register New Membership")'
));
}
/** @test */
public
function
forgotPasswordShouldBeAccessible
()
{
$crawler
=
$this
->
client
->
request
(
'GET'
,
'/auth/reset'
);
$this
->
assertTrue
(
$this
->
client
->
getResponse
()
->
isOk
());
$this
->
assertCount
(
1
,
$crawler
->
filter
(
'.header:contains("Reset Password")'
));
}
/** @test */
public
function
dashboardShouldNotBePubliclyAccessible
()
{
$this
->
app
[
'router'
]
->
enableFilters
();
Sentinel
::
logout
();
$crawler
=
$this
->
client
->
request
(
'GET'
,
'/'
.
Config
::
get
(
'core::core.admin-prefix'
));
$this
->
assertRedirectedTo
(
'auth/login'
);
}
/** @test */
public
function
dashboardShouldBeAccessibleIfLoggedIn
()
{
// $sentinelMock = Mockery::mock('Cartalyst\Sentinel\Laravel\Facades\Sentinel');
// $sentinelMock->shouldReceive('check')->andReturn(true);
$this
->
app
[
'router'
]
->
enableFilters
();
$user
=
Sentinel
::
findById
(
4
);
Sentinel
::
login
(
$user
);
$crawler
=
$this
->
client
->
request
(
'GET'
,
'/'
.
Config
::
get
(
'core::core.admin-prefix'
));
$this
->
assertTrue
(
$this
->
client
->
getResponse
()
->
isOk
());
$this
->
assertCount
(
1
,
$crawler
->
filter
(
'h1:contains("Dashboard")'
));
}
}
\ No newline at end of file
Tests/UrlTest.php
→
Tests/U
serU
rlTest.php
View file @
95973ff0
...
...
@@ -3,7 +3,7 @@
use
Cartalyst\Sentinel\Laravel\Facades\Sentinel
;
use
Illuminate\Support\Facades\Config
;
class
UrlTest
extends
\TestCase
class
U
serU
rlTest
extends
\TestCase
{
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