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
3e37af24
Commit
3e37af24
authored
Dec 24, 2017
by
Viral Solani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Feature/LoginTests
parent
4249416f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
25 deletions
+18
-25
ExampleTest.php
tests/Feature/ExampleTest.php
+0
-20
LoginTest.php
tests/Feature/LoginTest.php
+18
-5
No files found.
tests/Feature/ExampleTest.php
deleted
100644 → 0
View file @
4249416f
<?php
namespace
Tests\Feature
;
use
Tests\TestCase
;
class
ExampleTest
extends
TestCase
{
/**
* A basic test example.
*
* @return void
*/
public
function
testBasicTest
()
{
$response
=
$this
->
get
(
'/'
);
$response
->
assertSee
(
'Laravel AdminPanel'
);
}
}
tests/Feature/
Auth
Test.php
→
tests/Feature/
Login
Test.php
View file @
3e37af24
...
...
@@ -7,7 +7,7 @@ use Illuminate\Support\Facades\Auth;
use
Illuminate\Support\Facades\Event
;
use
Tests\BrowserKitTestCase
;
class
Auth
Test
extends
BrowserKitTestCase
class
Login
Test
extends
BrowserKitTestCase
{
/** @test */
public
function
login_page_loads_properly
()
...
...
@@ -20,17 +20,30 @@ class AuthTest extends BrowserKitTestCase
}
/** @test */
public
function
login_fail
ure_without_inputs
()
public
function
login_fail
s_when_a_required_field_is_not_filled_in
()
{
$this
->
visit
(
'/login'
)
->
type
(
''
,
'email'
)
->
type
(
''
,
'password'
)
->
press
(
'Login'
)
->
seePageIs
(
'/login'
)
->
see
(
'The email field is required.'
)
->
see
(
'The password field is required.'
);
}
/** @test */
public
function
login_fails_when_password_is_incorrect
()
{
$this
->
visit
(
'/login'
)
->
type
(
'admin@admin.com'
,
'email'
)
->
type
(
'invalidpass'
,
'password'
)
->
press
(
'Login'
)
->
seePageIs
(
'/login'
)
->
see
(
'The email field is required.'
)
->
see
(
'The password field is required.'
);
->
see
(
'These credentials do not match our records.'
);
}
/** @test */
public
function
test_
login_failure_with_wrong_inputs
()
public
function
login_failure_with_wrong_inputs
()
{
$this
->
visit
(
"/login"
)
->
type
(
'wrongusername@wrongpassword.com'
,
'email'
)
...
...
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