Note that there are some explanatory texts on larger screens.

plurals
  1. PObuilding and testing a new ZF2 application
    text
    copied!<p>I've been following <a href="http://framework.zend.com/manual/2.0/en/user-guide/unit-testing.html" rel="nofollow">ZF2 tutorials</a> on where/how to write unit tests for modules while I'm writing an application. Right now each module has its own <code>test</code> dir with its own <code>Bootstrap.php</code> and <code>phpunit.xml</code> config file. </p> <p><strong>Current Application Shell</strong></p> <pre><code>Application +--config/ +--public/ +--module/ | +--Module-A | | +--config | | +--src | | +--tests | | +--view | +--Module-B | +--config | +--src | +--tests | +--view +--vendor/ </code></pre> <p>Problem I'm running into is - its pretty darn hard to run ALL my tests at once for my entire application. I have to run each module's test separately - which is making my Jenkins CI setup a bit more complicated ie: aggregating code coverage files, junit, clover, etc...</p> <p><strong>Proposed Application Shell</strong></p> <pre><code>Application +--config/ +--public/ +--module/ | +--Module-A | | +--config | | +--src | | +--view | +--Module-B | +--config | +--src | +--view +--vendor/ +--tests/ +--Module-A +--Module-B </code></pre> <p>So in my search for a solution I have noticed the <a href="https://github.com/zendframework/zf2/tree/master/tests" rel="nofollow">Zend github repo</a> still has a separate <code>tests</code> directory that looks to mirror the library modules. Following this pattern where I can run all the tests and collect metrics all together would make my life much easier. </p> <p>So my real question is....</p> <p>What is the correct way I'm supposed to be doing this? If I'm writing 3rd party plugins that will be published - should I be including the tests into the module directory; and if I'm writing plugins that will be kept w/ this application for custom logic should/can I create a root folder and mirror my modules directory and hold the tests there?</p> <p>or am I doing all this the hard way?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload