Pros/Cons of placing "test[s]" folder in your "module" directory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Pros/Cons of placing "test[s]" folder in your "module" directory

dennis-fedco
Is there any significant benefit or detriment in placing my "test[s]" folder inside the "module" directory structure rather than at the project level?

Example:  "module/ModuleName/test/"

Some Pros:
* Encapsulation.  For example, the module and its tests can be moved as a unit from one project into the other.  Otherwise you have to go into "test[s]" folder at the project level and pull out relevant tests to go with it, assuming all tests have been placed into the project level "test[s]" folder.

Some Cons:
* In my autoload I have to set up secondary namespace lookup, which theoretically creates extra work for PSR:
 
     "psr-4": {
         "ModuleName\\" : ["module/ModuleName/src", "module/ModuleName"],
      }

Dennis
Reply | Threaded
Open this post in threaded view
|

Re: Pros/Cons of placing "test[s]" folder in your "module" directory

Daniel
It also makes it harder to ignore the tests when creating a "deployable"
package.

Em qui, 17 de dez de 2015 às 16:20, dennis-fedco <[hidden email]>
escreveu:

> Is there any significant benefit or detriment in placing my "test[s]"
> folder
> inside the "module" directory structure rather than at the project level?
>
> Example:  "module/ModuleName/test/"
>
> Some Pros:
> * Encapsulation.  For example, the module and its tests can be moved as a
> unit from one project into the other.  Otherwise you have to go into
> "test[s]" folder at the project level and pull out relevant tests to go
> with
> it, assuming all tests have been placed into the project level "test[s]"
> folder.
>
> Some Cons:
> * In my autoload I have to set up secondary namespace lookup, which
> theoretically creates extra work for PSR:
>
>
> Dennis
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Pros-Cons-of-placing-test-s-folder-in-your-module-directory-tp4662794.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>
> --

Daniel Gimenes
twitter.com/danizord
github.com/danizord