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
89330e07
Commit
89330e07
authored
2 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Patches
Plain Diff
feature(ajax): added nonce
parent
e90452b9
No related branches found
No related tags found
1 merge request
!26
feature(ajax): added nonce
Pipeline
#166096
failed
2 years ago
Stage: prepare-vendor
Stage: tools
Stage: tests
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/codeception/tests/integration.suite.yml
+15
-0
15 additions, 0 deletions
tests/codeception/tests/integration.suite.yml
tests/codeception/tests/integration/AjaxHandlerTest.php
+2
-2
2 additions, 2 deletions
tests/codeception/tests/integration/AjaxHandlerTest.php
with
17 additions
and
2 deletions
tests/codeception/tests/integration.suite.yml
+
15
−
0
View file @
89330e07
...
...
@@ -4,8 +4,23 @@
modules
:
enabled
:
-
WPDb
-
WPLoader
config
:
WPDb
:
dsn
:
'
mysql:host=%TEST_SITE_DB_HOST%;dbname=%TEST_SITE_DB_NAME%'
user
:
'
%TEST_SITE_DB_USER%'
password
:
'
%TEST_SITE_DB_PASSWORD%'
dump
:
'
tests/codeception/tests/_data/db.sql'
#import the dump before the tests; this means the test site database will be repopulated before the tests.
populate
:
false
# re-import the dump between tests; this means the test site database will be repopulated between the tests.
cleanup
:
false
waitlock
:
10
url
:
'
%TEST_SITE_WP_URL%'
originalUrl
:
'
%TEST_SITE_WP_URL%'
urlReplacement
:
true
#replace the hardcoded dump URL with the one above
tablePrefix
:
'
%TEST_SITE_TABLE_PREFIX%'
WPLoader
:
multisite
:
false
wpRootFolder
:
'
%WP_ROOT_FOLDER%'
...
...
This diff is collapsed.
Click to expand it.
tests/codeception/tests/integration/
Test
AjaxHandler.php
→
tests/codeception/tests/integration/AjaxHandler
Test
.php
+
2
−
2
View file @
89330e07
...
...
@@ -6,7 +6,7 @@ use Codeception\TestCase\WPTestCase;
use
\WPDesk\Notice\AjaxHandler
;
use
\WPDesk\Notice\PermanentDismissibleNotice
;
class
Test
AjaxHandler
extends
WPTestCase
{
class
AjaxHandler
Test
extends
WPTestCase
{
const
ASSETS_URL
=
'http://test.com/test/assetes/'
;
const
NOTICE_NAME
=
'test_notice_name'
;
...
...
@@ -68,7 +68,7 @@ class TestAjaxHandler extends WPTestCase {
$ajaxHandler
->
hooks
();
$this
->
expectOutputString
(
'<script type="text/javascript">
'
.
file_get_contents
(
__DIR__
.
'/../../assets/js/notice.js'
)
.
'
jQuery(document).on("click",".notice-dismiss",function(){var a=jQuery(this).closest("div.notice").data("notice-name");var b=jQuery(this).closest("div.notice").data("source");if(""!==a){jQuery.ajax({url:ajaxurl,type:"post",data:{action:"wpdesk_notice_dismiss",notice_name:a,source:b},success:function(c){}})}});jQuery(document).on("click",".notice-dismiss-link",function(){jQuery(this).closest("div.notice").data("source",jQuery(this).data("source"));jQuery(this).closest("div.notice").find(".notice-dismiss").click()});
</script>
'
);
...
...
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