Skip to content

BrainMonkey\YoastTestCase: make the is_multisite() stub more versatile#22

Merged
jrfnl merged 1 commit intodevelopfrom
feature/brainmonkey-testcase-improve-is-multisite-stub
Sep 26, 2021
Merged

BrainMonkey\YoastTestCase: make the is_multisite() stub more versatile#22
jrfnl merged 1 commit intodevelopfrom
feature/brainmonkey-testcase-improve-is-multisite-stub

Conversation

@jrfnl
Copy link
Copy Markdown
Collaborator

@jrfnl jrfnl commented Sep 26, 2021

The stubbed is_multisite() function would previously always return false.

For integration tests, the WP Core test suite supports setting a WP_TESTS_MULTISITE PHP constant in the phpunit.xml[.dist] configuration to indicate that the test suite should be run in a multisite context.

While BrainMonkey tests are run stand-alone, this commit changes the behaviour of the is_multisite() stub to respect a potentially set WP_TESTS_MULTISITE constant, allowing for BrainMonkey based tests to test specific logic paths in plugin/theme code which are only run in a multisite context.

The stubbed `is_multisite()` function would previously always return `false`.

For integration tests, the WP Core test suite supports setting a `WP_TESTS_MULTISITE` PHP constant in the `phpunit.xml[.dist]` configuration to indicate that the test suite should be run in a multisite context.

While BrainMonkey tests are run stand-alone, this commit changes the behaviour of the `is_multisite()` stub to respect a potentially set `WP_TESTS_MULTISITE` constant, allowing for BrainMonkey based tests to test specific logic paths in plugin/theme code which are only run in a multisite context.
@jrfnl jrfnl added enhancement New feature or request yoastcs/qa labels Sep 26, 2021
@jrfnl jrfnl added this to the 1.0.0 milestone Sep 26, 2021
@jrfnl jrfnl merged commit 1ae9c2c into develop Sep 26, 2021
@jrfnl jrfnl deleted the feature/brainmonkey-testcase-improve-is-multisite-stub branch September 26, 2021 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request yoastcs/qa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant