Issues

ZF-11423: creation of module controllers through Zend_Tool overwrites controller tests of application

Description

Scenario: you have a "Projects" controller in your application as well as in an "admin" module.

When I create a controller for a module through the zf command on the command line, it will overwrite an existing ProjectsControllerTest for the application controller with an empty/stubbed test case class of the same name.

Instead, the controller test case should be created within a subfolder that mirrors the project structure, i.e. in tests/modules//controllers

Comments

Could not reproduce the issue against the SVN trunk. Here is what I did:


[adam@zfdev zf]$ zf create project ZF-11423
[adam@zfdev ZF-11423]$ zf create module admin
Creating the following module and artifacts:
/tmp/zf/ZF-11423/application/modules/admin/controllers
/tmp/zf/ZF-11423/application/modules/admin/models
/tmp/zf/ZF-11423/application/modules/admin/views
/tmp/zf/ZF-11423/application/modules/admin/views/scripts
/tmp/zf/ZF-11423/application/modules/admin/views/helpers
/tmp/zf/ZF-11423/application/modules/admin/views/filters
Added a key for path module directory to the application.ini file
Updating project profile '/tmp/zf/ZF-11423/.zfproject.xml'

[adam@zfdev ZF-11423]$ zf create controller Home
Creating a controller at /tmp/zf/ZF-11423/application/controllers/HomeController.php
Creating an index action method in controller Home
Creating a view script for the index action method at /tmp/zf/ZF-11423/application/views/scripts/home/index.phtml
Creating a controller test file at /tmp/zf/ZF-11423/tests/application/controllers/HomeControllerTest.php
Updating project profile '/tmp/zf/ZF-11423/.zfproject.xml'

[adam@zfdev ZF-11423]$ zf create controller Home index-action-included=1 admin
Creating a controller at /tmp/zf/ZF-11423/application/modules/admin/controllers/HomeController.php
Creating an index action method in controller Home
Creating a view script for the index action method at /tmp/zf/ZF-11423/application/modules/admin/views/scripts/home/index.phtml
Creating a controller test file at /tmp/zf/ZF-11423/tests/application/modules/admin/controllers/HomeControllerTest.php
Updating project profile '/tmp/zf/ZF-11423/.zfproject.xml'

[adam@zfdev  ZF-11423]$ find . -name "*Test.php"
./tests/application/controllers/IndexControllerTest.php
./tests/application/controllers/HomeControllerTest.php
./tests/application/modules/admin/controllers/HomeControllerTest.php

As you can see, both controller tests are created in their proper locations.

Could you provide a similar transcript from your system which shows the controller test file ending up in the wrong location?