Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Ensure listener detachment works cross-version #96

Merged
merged 2 commits into from
Mar 8, 2016

Conversation

weierophinney
Copy link
Member

Check if a returned callback is a CallbackHandler, and, if so, pull the actual PHP callable from it before testing for the class. To ensure both BC and forwards compatibility, ensure that the priority is stored when detaching, so that re-attaching will continue to work.

In order to use composer update --prefer-lowest (which I did for testing against zend-eventmanager v2), I had to:

  • update PHPUnit to ^4.5, as that's the first version using prophecy, which we're using in tests now.
  • add sebastian/version:^1.0.4, as that's the first version that fixes version autodiscovery, ensuring that the test runner knows we're on a version later than 2.5.

Tests for this are ridiculously hard to write; would love some review!

Check if a returned callback is a CallbackHandler, and, if so, pull the actual
PHP callable from it before testing for the class. To ensure both BC and
forwards compatibility, ensure that the priority is stored when detaching, so
that re-attaching will continue to work.

In order to use `composer update --prefer-lowest`, I had to:

- update PHPUnit to `^4.5`, as that's the first version using prophecy, which we're
  using in tests now.
- add sebastian/version:^1.0.4, as that's the first version that fixes version
  autodiscovery, ensuring that the test runner knows we're on a version later
  than 2.5.
@weierophinney
Copy link
Member Author

Forgot to note that this addresses #90.

@weierophinney weierophinney added this to the 2.7.2 milestone Mar 8, 2016
@weierophinney weierophinney self-assigned this Mar 8, 2016
weierophinney added a commit that referenced this pull request Mar 8, 2016
weierophinney added a commit that referenced this pull request Mar 8, 2016
@weierophinney weierophinney merged commit 4bbb48b into zendframework:master Mar 8, 2016
weierophinney added a commit that referenced this pull request Mar 8, 2016
@weierophinney weierophinney deleted the hotfix/90 branch March 8, 2016 17:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant