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
Description
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 runningzend-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 inZendTest\*
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
(notautoload-dev
) to load the common test classes in namespaceZendTest\*
- set
require
(notrequire-dev
) to depend onzend-servicemanager
and everything else required to use these test classes
- set
- 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
:
- https://github.com/marc-mabe/zend-cache-test
- https://github.com/marc-mabe/zend-cache
- https://github.com/marc-mabe/zend-cache-apc
Ping @weierophinney @Ocramius
Metadata
Metadata
Assignees
Labels
No labels