Skip to content
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

Adds unit tests and is_module_active method to SAL. #11010

Merged
merged 7 commits into from Dec 21, 2018
Merged

Conversation

zinigor
Copy link
Member

@zinigor zinigor commented Dec 19, 2018

In order to synchronize code between Jetpack and WordPress.com better one of the little pieces we needed was the is_module_active method present in the Site Abstraction Layer. This change adds it as well as enforcing its existence in all extending classes.

Changes proposed in this Pull Request:

  • Adds unit tests that will run on SAL classes.
  • Adds the is_module_active method for SAL Sites.

Testing instructions:

  • Functionally there's nothing to change, just run the tests.
  • This should fail on wpcom check after being created, this is expected, because the method needs to be added on the other side as well.

Proposed changelog entry for your changes:

  • Added base unit test suites for the SAL library.

This blocks #10945

@zinigor zinigor added [Status] Needs Review To request a review from Crew. Label will be renamed soon. [Type] Janitorial labels Dec 19, 2018
@zinigor zinigor requested a review from lezama December 19, 2018 21:42
@zinigor zinigor requested a review from a team as a code owner December 19, 2018 21:42
@matticbot
Copy link
Contributor

D22570-code. (newly created revision)

@jetpackbot
Copy link

jetpackbot commented Dec 19, 2018

Warnings
⚠️

The PR is missing at least one [Status] label. Suggestions: [Status] In Progress, [Status] Needs Review

This is automated check which relies on PULL_REQUEST_TEMPLATE.We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS against 6fcd58d

lezama
lezama previously approved these changes Dec 20, 2018
Copy link
Contributor

@lezama lezama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @zinigor 🙇

@zinigor zinigor added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Dec 20, 2018
@@ -96,6 +96,14 @@ function get_jetpack_modules() {
return null;
}

function is_module_active( $module ) {
if ( is_user_member_of_blog() ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the membership check here?

@ghost ghost removed the [Status] Ready to Merge Go ahead, you can push that green button! label Dec 20, 2018
@@ -89,11 +89,11 @@ function after_render_options( &$options ) {
}

function get_jetpack_modules() {
if ( is_user_member_of_blog() ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we remove the check from here we will want to add it in json-endpoints/class.wpcom-json-api-get-site-endpoint.php

@zinigor
Copy link
Member Author

zinigor commented Dec 21, 2018

This is already deployed on the other side. Thanks, Miguel!

@zinigor zinigor added the [Status] Ready to Merge Go ahead, you can push that green button! label Dec 21, 2018
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. Merging.

@jeherve jeherve merged commit a17c5da into master Dec 21, 2018
@jeherve jeherve deleted the add/sal-unit-tests branch December 21, 2018 14:29
@ghost ghost removed the [Status] Ready to Merge Go ahead, you can push that green button! label Dec 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants