Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Dependency issue with test requirement #182

Open
@marc-mabe

Description

@marc-mabe

This component ships a trait used by other components in tests.
Now with 07d53d3 the tests have been upgraded to PHPUnit5 and tests of other components fails because they still using PHPUnit4.
E.g.: https://travis-ci.org/marc-mabe/zend-cache/jobs/203261654

The main problem is not to have a reusable trait for tests or the upgraded PHPUnit dependency but:

  • The dependency of PHPUnit5 is defined in require-dev - so only valid running zend-servicemanager in development environment but not verified by other components
  • Can't be moved to require as then every production environment would load PHPUnit and it's dependencies
  • The test trait will be available for everyone even in production environment but they shouldn't use it 😕
  • The test trait is in namespace Zend\ServiceManager\Test but it should be in ZendTest\*

To solve this I would do the following (like what I started to do with splitting zend-cache):

  • create own repo for reusable test classes (like zend-servicemanager-test)
    • set autoload (not autoload-dev) to load the common test classes in namespace ZendTest\*
    • set require (not require-dev) to depend on zend-servicemanager and everything else required to use these test classes
  • add require-dev: zend-servicemanager-test in this component and all components using this class
    -> Now the dependencies of such test classes are defined by composer and they are not part of any production environment

How this would look like as I started to do that with zend-cache:

Ping @weierophinney @Ocramius

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions