Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-notice
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-notice
Commits
7f333b2e
Commit
7f333b2e
authored
6 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Patches
Plain Diff
More tests.
parent
fc92d5b3
No related branches found
No related tags found
1 merge request
!3
Feature/more tests
Pipeline
#6886
passed with warnings
6 years ago
Stage: tools
Stage: tests
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/integration/TestPermanentDismissinleNotice.php
+19
-0
19 additions, 0 deletions
tests/integration/TestPermanentDismissinleNotice.php
with
19 additions
and
0 deletions
tests/integration/TestPermanentDismissinleNotice.php
+
19
−
0
View file @
7f333b2e
...
...
@@ -5,6 +5,8 @@ use \WPDesk\Notice\PermanentDismissibleNotice;
class
TestPermanentDismissinleNotice
extends
WP_UnitTestCase
{
const
NOTICE_NAME
=
'test_notice_name'
;
public
function
testAddAction
()
{
$notice_priority
=
11
;
...
...
@@ -19,6 +21,23 @@ class TestPermanentDismissinleNotice extends WP_UnitTestCase
$this
->
assertEquals
(
$notice_priority
,
has_action
(
'admin_notices'
,
[
$notice
,
'showNotice'
],
$notice_priority
));
}
public
function
testUndoDismiss
()
{
update_option
(
PermanentDismissibleNotice
::
OPTION_NAME_PREFIX
.
self
::
NOTICE_NAME
,
PermanentDismissibleNotice
::
OPTION_VALUE_DISMISSED
);
$notice
=
new
PermanentDismissibleNotice
(
PermanentDismissibleNotice
::
NOTICE_TYPE_INFO
,
'test'
,
self
::
NOTICE_NAME
);
$notice
->
undoDismiss
();
$this
->
assertEquals
(
''
,
get_option
(
PermanentDismissibleNotice
::
OPTION_NAME_PREFIX
.
self
::
NOTICE_NAME
,
''
)
);
}
public
function
testShowNotice
()
{
$notice
=
new
PermanentDismissibleNotice
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment