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
ec1d8544
Commit
ec1d8544
authored
Dec 26, 2017
by
Viral Solani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test cases for History
parent
2fb7e180
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
93 deletions
+18
-93
HistoryRenderTypeTest.php
tests/Backend/History/HistoryRenderTypeTest.php
+0
-70
HistoryLogTest.php
tests/Feature/Backend/History/HistoryLogTest.php
+6
-2
HistoryRenderEntityTest.php
tests/Feature/Backend/History/HistoryRenderEntityTest.php
+5
-2
HistoryRenderTest.php
tests/Feature/Backend/History/HistoryRenderTest.php
+6
-18
ManagePageTest.php
tests/Feature/Backend/ManagePageTest.php
+1
-1
No files found.
tests/Backend/History/HistoryRenderTypeTest.php
deleted
100644 → 0
View file @
2fb7e180
<?php
use
Tests\BrowserKitTestCase
;
/**
* Class HistoryRenderTypeTest.
*/
class
HistoryRenderTypeTest
extends
BrowserKitTestCase
{
public
function
testViewOnlyHasHistoryOfType
()
{
$this
->
actingAs
(
$this
->
admin
);
history
()
->
withType
(
'User'
)
->
withText
(
'trans("history.backend.users.created") '
.
$this
->
user
->
name
)
->
withEntity
(
$this
->
user
->
id
)
->
withIcon
(
'plus'
)
->
withClass
(
'bg-green'
)
->
log
();
history
()
->
withType
(
'User'
)
->
withText
(
'trans("history.backend.users.updated") '
.
$this
->
user
->
name
)
->
withEntity
(
$this
->
user
->
id
)
->
withIcon
(
'pencil'
)
->
withClass
(
'bg-blue'
)
->
log
();
history
()
->
withType
(
'User'
)
->
withText
(
'trans("history.backend.users.deleted") '
.
$this
->
user
->
name
)
->
withEntity
(
$this
->
user
->
id
)
->
withIcon
(
'trash'
)
->
withClass
(
'bg-red'
)
->
log
();
history
()
->
withType
(
'Role'
)
->
withText
(
'trans("history.backend.roles.created") '
.
$this
->
adminRole
->
name
)
->
withEntity
(
$this
->
adminRole
->
id
)
->
withIcon
(
'plus'
)
->
withClass
(
'bg-red'
)
->
log
();
history
()
->
withType
(
'Role'
)
->
withText
(
'trans("history.backend.roles.updated") '
.
$this
->
adminRole
->
name
)
->
withEntity
(
$this
->
adminRole
->
id
)
->
withIcon
(
'pencil'
)
->
withClass
(
'bg-red'
)
->
log
();
history
()
->
withType
(
'Role'
)
->
withText
(
'trans("history.backend.roles.deleted") '
)
->
withEntity
(
$this
->
adminRole
->
id
)
->
withIcon
(
'trash'
)
->
withClass
(
'bg-red'
)
->
log
();
$this
->
visit
(
'/admin/access/user'
)
->
see
(
'<strong>'
.
$this
->
admin
->
name
.
'</strong> created user '
.
$this
->
user
->
name
)
->
see
(
'<strong>'
.
$this
->
admin
->
name
.
'</strong> updated user '
.
$this
->
user
->
name
)
->
see
(
'<strong>'
.
$this
->
admin
->
name
.
'</strong> deleted user '
.
$this
->
user
->
name
)
->
dontSee
(
'<strong>'
.
$this
->
admin
->
name
.
'</strong> created role '
.
$this
->
adminRole
->
name
)
->
dontSee
(
'<strong>'
.
$this
->
admin
->
name
.
'</strong> updated role '
.
$this
->
adminRole
->
name
)
->
dontSee
(
'<strong>'
.
$this
->
admin
->
name
.
'</strong> deleted role '
.
$this
->
adminRole
->
name
);
}
}
tests/Backend/History/HistoryLogTest.php
→
tests/
Feature/
Backend/History/HistoryLogTest.php
View file @
ec1d8544
<?php
namespace
Tests\Feature\Backend\History
;
use
Tests\BrowserKitTestCase
;
/**
...
...
@@ -7,7 +9,8 @@ use Tests\BrowserKitTestCase;
*/
class
HistoryLogTest
extends
BrowserKitTestCase
{
public
function
testHistoryLogByTypeNameFunction
()
/** @test **/
public
function
history_log_by_type_name_function
()
{
$this
->
actingAs
(
$this
->
admin
);
...
...
@@ -32,7 +35,8 @@ class HistoryLogTest extends BrowserKitTestCase
->
see
(
'<strong>'
.
$this
->
admin
->
name
.
'</strong> '
.
trans
(
'history.backend.users.created'
)
.
$this
->
user
->
name
);
}
public
function
testHistoryLogByTypeIdFunction
()
/** @test **/
public
function
history_log_By_TypeId_Function
()
{
$this
->
actingAs
(
$this
->
admin
);
...
...
tests/Backend/History/HistoryRenderEntityTest.php
→
tests/
Feature/
Backend/History/HistoryRenderEntityTest.php
View file @
ec1d8544
<?php
use
App\Models\Access\User\User
;
namespace
Tests\Feature\Backend\History
;
use
Tests\BrowserKitTestCase
;
use
App\Models\Access\User\User
;
/**
* Class HistoryRenderEntityTest.
*/
class
HistoryRenderEntityTest
extends
BrowserKitTestCase
{
public
function
testViewOnlyHasHistoryOfEntity
()
/** @test **/
public
function
users_can_see_history_of_entity
()
{
$this
->
actingAs
(
$this
->
admin
);
...
...
tests/Backend/History/HistoryRenderTest.php
→
tests/
Feature/
Backend/History/HistoryRenderTest.php
View file @
ec1d8544
<?php
namespace
Tests\Feature\Backend\History
;
use
Tests\BrowserKitTestCase
;
/**
...
...
@@ -7,7 +9,8 @@ use Tests\BrowserKitTestCase;
*/
class
HistoryRenderTest
extends
BrowserKitTestCase
{
public
function
testDashboardDisplaysHistory
()
/** @test **/
public
function
admin_users_can_see_history_on_dashboard
()
{
$this
->
actingAs
(
$this
->
admin
);
...
...
@@ -23,23 +26,8 @@ class HistoryRenderTest extends BrowserKitTestCase
->
see
(
'<strong>'
.
$this
->
admin
->
name
.
'</strong> '
.
trans
(
'history.backend.users.created'
)
.
$this
->
user
->
name
);
}
public
function
testTypeDisplaysHistory
()
{
$this
->
actingAs
(
$this
->
admin
);
history
()
->
withType
(
'User'
)
->
withText
(
trans
(
'history.backend.users.created'
)
.
$this
->
user
->
name
)
->
withEntity
(
$this
->
user
->
id
)
->
withIcon
(
'plus'
)
->
withClass
(
'bg-green'
)
->
log
();
$this
->
visit
(
'/admin/access/user'
)
->
see
(
'<strong>'
.
$this
->
admin
->
name
.
'</strong> '
.
trans
(
'history.backend.users.created'
)
.
$this
->
user
->
name
);
}
public
function
testEntityDisplaysHistory
()
/** @test **/
public
function
admin_users_can_see_history_on_user_show_page
()
{
$this
->
actingAs
(
$this
->
admin
);
...
...
tests/Feature/ManagePageTest.php
→
tests/Feature/
Backend/
ManagePageTest.php
View file @
ec1d8544
<?php
namespace
Tests\Feature
;
namespace
Tests\Feature
\Backend
;
use
App\Models\Page\Page
;
use
Tests\TestCase
;
...
...
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