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

Prevent duplicate notices #37

Merged
merged 1 commit into from
Jun 27, 2017
Merged

Conversation

andreasciamanna
Copy link
Contributor

When the admin_notices hook is created, raise a flag in a global variable to avoid hooking multiple times.

See #36

I would like to add tests coverage to this whole class, but I'd need to add 10up/wp_mock, lucatume/function-mocker or something similar to mock global functions such as wp_kses.

If that's not a problem, I can add tests to this PR in a separate commit.

When the `admin_notices` hook is created, raise a flag in a global variable to avoid hooking multiple times.

See Yoast#36
@andreasciamanna
Copy link
Contributor Author

It looks like I can't use WP_Mock without first upgrading PHPUnit to a more recent version.

I may need some inputs on how I can mock global functions, I can deal with the tests, provided you want me to do that.

@andreasciamanna
Copy link
Contributor Author

Not to be pushy, but will this PR be merged (even without tests)?

I'm preparing a new major release and I would like to include this library to start nagging our users :)

@atimmer atimmer added the queue label Jun 26, 2017
@atimmer
Copy link
Contributor

atimmer commented Jun 26, 2017

@sciamannikoo No problem, I have asked our plugin team to take a look at the pull request.

@boblinthorst boblinthorst self-assigned this Jun 27, 2017
@boblinthorst
Copy link
Contributor

Code Review: 👍 , acceptance: 👍

I might get back on creating unit tests.

@boblinthorst boblinthorst merged commit e209514 into Yoast:master Jun 27, 2017
DrewAPicture added a commit to DrewAPicture/whip that referenced this pull request Aug 4, 2017
jcomack added a commit that referenced this pull request Aug 8, 2017
Effectively revert #37 in favor of a hook-based solution for duplicate notices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants