-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PHPUnit tests for mu-plugins #204
base: trunk
Are you sure you want to change the base?
Conversation
…site_url() which won't work for files in /style/
This reverts commit 9897577.
Aside from the hacky An upstream issue to allow removing the hacky hack above is here: WordPress/gutenberg#41083 |
@@ -21,7 +21,10 @@ | |||
"composer/installers": "~1.0" | |||
}, | |||
"require-dev": { | |||
"wporg/wporg-repo-tools": "dev-trunk" | |||
"phpunit/phpunit": "^9.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure if this is actually needed here, I suspect it's not, as it would only be needed if you're running phpunit
outside of wp-env
.
The below wp-phpunit & yoast deps are however required.
<?php | ||
|
||
class Test_CDN_Assets extends WP_UnitTestCase { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a setUp/tearDown method to check/reset the environmental WP_ENVIRONMENT_TYPE value.
Ha. No I didn't. I changed the base target of this PR, the old base branch for the PR was deleted. |
This PR adds unit tests to #173
I've separated it due to the amount of work I had to do to make it work.
wp_get_environment_type()
is not exactly designed to be used during unit testing, and while it allows for it to be bypassed,wp-env
forces phpunit to be alocal
environment.Draft while I figure out if it's viable.