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

Prepare for zend-servicemanager/zend-stdlib v3 #18

Merged

Conversation

weierophinney
Copy link
Member

This patch prepares zend-file for the v3 releases of zend-servicemanager and zend-stdlib. I'm marking it as a work-in-progress, as I'm unsure it should be completed before zend-validator is completed.

Currently, it does the following:

  • Updates composer.json to use either the v2 or v3 versions of zend-stdlib and zend-servicemanager.
  • Updates composer.json to use forwards-compatible versions of components that rely on zend-servicemanager, if such versions exist.
  • Updates .travis.yml to do two jobs per PHP version, one against zend-servicemanager v3, the other against v2.
  • Updates .travis.yml to remove zend-validator and zend-progressbar from the dev requirements when running against zend-servicemanager v3.
  • Updates code to work with zend-servicemanager v3, and updates test expectations where required; some tests are now marked skipped based on dependencies not being forwards-compatible.

Unfortunately, Zend\File\Transfer\Adapter\AbstractAdapter currently composes both filter and validator plugin managers, and its primary duty is to perform upload validation. The AbstractTest is able to skip tests that interact with the validator plugin manager, but the HttpTest cannot, as the HTTP adapter sets an initial Upload validator during instantiation. Since this is so fundamental, my gut feeling is to wait for zend-validator to be complete before we consider this for merge.

Update: this patch has been updated to pin against zend-validator ^2.6, which brings in the forwards-compatibility changes, allowing me to test all functionality except for one or two progress bar items. As such, it's ready.

Updated `composer.json`:

- Use v2 or v3 versions of stdlib, servicemanager.
- Use latest versions of components that are forwards compatible.

Updated `.travis.yml`:

- added test jobs to test zend-servicemanager v2 usage separately from v3.
- remove zend-validator and zend-progressbar when running against
  zend-servicemanager v3.

Test updates:

- skip tests related to validation when validator interface is missing.
- skip tests related to progress bars when progress bar adapter is missing.
- Due to type checking in v2 vs v3 of zend-servicemanager, and the fact that
  zend-validator has not yet been updated, we need to check which version of
  zend-servicemanager we're running against before lazy-instantiating the
  validator plugin manager.
- zend-filter is already updated, so we can use the v3 paradigm when
  lazy-instantiating the filter plugin manager.
- skip the HTTP-adapter tests, as that adapter *requires* the validator plugin
  manager (it auto-injects the Upload validator during instantiation).
- update the tests for filters as they use namespace separators in non-FQCN
  filter names.
@weierophinney weierophinney added this to the 2.6.0 milestone Feb 16, 2016
@gianarb
Copy link

gianarb commented Feb 17, 2016

👍

- Updated zend-validator dependency to `^2.6`, bringing in forwards-compat
  changes.
  - Removed code that was skipping zend-validator tests.
- Moved aliases definitions in `ValidatorPluginManager` implementation to an
  alternate property, and defined a constructor that merges them with the parent
  `$aliases` prior to invoking the parent constructor.
- Fixed an issue with filter resolution (added more aliases).
@weierophinney weierophinney merged commit 69f4e44 into zendframework:develop Feb 17, 2016
weierophinney added a commit that referenced this pull request Feb 17, 2016
weierophinney added a commit that referenced this pull request Feb 17, 2016
@weierophinney weierophinney deleted the feature/sm-forwards-compat branch February 17, 2016 19:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants