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
1fc35183
Commit
1fc35183
authored
2 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Patches
Plain Diff
feature(ajax): added nonce
parent
c18ea4cf
No related branches found
No related tags found
1 merge request
!26
feature(ajax): added nonce
Pipeline
#166082
passed
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
.gitlab-ci.yml
+66
-0
66 additions, 0 deletions
.gitlab-ci.yml
tests/integration/TestAjaxHandler.php
+2
-1
2 additions, 1 deletion
tests/integration/TestAjaxHandler.php
with
68 additions
and
1 deletion
.gitlab-ci.yml
+
66
−
0
View file @
1fc35183
...
...
@@ -6,3 +6,69 @@ variables:
include
:
'
https://gitlab.com/wpdesk/gitlab-ci/raw/master/gitlab-ci-1.2.yml'
integration codeception tests
:
tags
:
-
codeception
-
$TESTS_TAG
image
:
name
:
wpdesknet/codeception:11
entrypoint
:
[
"
"
]
variables
:
WP_CLI_CACHE_DIR
:
/cache/wp-cli
APACHE_DOCUMENT_ROOT
:
${CI_PROJECT_DIR}/tests/wordpress
CI_DEBUG_SERVICES
:
trace
services
:
-
name
:
mysql:5.6
alias
:
mysqltests
command
:
[
--max-allowed-packet=67108864
]
needs
:
-
prepare prefixed vendor
-
job
:
prepare translations
optional
:
true
-
job
:
prepare tests
optional
:
true
-
job
:
prepare npm assets
optional
:
true
artifacts
:
when
:
always
expire_in
:
1 month
name
:
"
acceptance
logs"
paths
:
-
tests/codeception/tests/_output
reports
:
junit
:
tests/codeception/tests/_output/report.xml
stage
:
tests
rules
:
-
if
:
'
$CI_PIPELINE_SOURCE
==
"merge_request_event"'
when
:
never
-
exists
:
-
tests/codeception/tests/integration.suite.yml
allow_failure
:
false
interruptible
:
true
before_script
:
-
echo "xdebug.max_nesting_level=2560" >> /usr/local/etc/php/php.ini
-
export DEPENDENT_PLUGINS_DIR=${CI_PROJECT_DIR}/tests/dependent_plugins
-
export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts)
-
export WOOTESTS_IP=127.0.0.1
-
export TEST_SITE_WP_URL="http://${WOOTESTS_IP}"
-
cd ${CI_PROJECT_DIR}
-
mkdir -p /project
-
cd ${CI_PROJECT_DIR}
-
mkdir -p ${APACHE_DOCUMENT_ROOT}
-
cd ${APACHE_DOCUMENT_ROOT}
-
cd ${CI_PROJECT_DIR}
-
composer prepare-wordpress-for-codeception
-
composer prepare-local-codeception-tests
-
chmod -R a+w ${APACHE_DOCUMENT_ROOT}/wp-content/uploads
-
touch ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
-
chmod a+w ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log
-
echo "End before"
-
cd ${CI_PROJECT_DIR}
script
:
-
vendor/bin/codecept run integration --steps --xml --html -f --verbose
after_script
:
-
cp ${APACHE_DOCUMENT_ROOT}/wp-content/debug.log tests/codeception/tests/_output/debug.log ||
true
-
cp ${APACHE_DOCUMENT_ROOT}/wp-content/uploads/wpdesk-logs/wpdesk_debug.log tests/codeception/tests/_output/wpdesk_debug.log ||
true
-
rm -r ${APACHE_DOCUMENT_ROOT}
This diff is collapsed.
Click to expand it.
tests/integration/TestAjaxHandler.php
+
2
−
1
View file @
1fc35183
...
...
@@ -62,7 +62,8 @@ class TestAjaxHandler extends WP_UnitTestCase
$ajaxHandler
->
hooks
();
$this
->
expectOutputString
(
'<script type="text/javascript">
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>
'
.
file_get_contents
(
__DIR__
.
'/../../assets/js/notice.js'
)
.
'
</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