"Create new PHP Test" wrong settings

In my project, when I right click on a php class and I do New > PHP Test > PHP Unit Test, values like the test class directory and the namespace are wrong, and the Member table is very thin and I see only one method at time. There is any way to manually map the folders so the right fodlers and namespaces are suggested and there is a way to have the member table bigger?

0
3 comments

values like the test class directory and the namespace are wrong

These values are taken from the source and test roots that have PSR-0/4 roots specified.

You can either configure them manually or add proper namespace mappings to your composer.json (autoload stands for source roots and autoload-dev for test roots).

I've recorded a short screencast to showcase this.

and the Member table is very thin and I see only one method at time

Expand the windows vertically and click OK, next time you invoke the window, it should auto-expand.

0

Thanks a lot for your reply. Unfortunately your solution doesn't work for me. The structure of the application is like a suite of apps, but since they are all thigh together they have to be on the same project, but for maintenance purpose they have a test folder each, so the structure is like:

suite/
commonCode/
src/
tests/
componentApp1/
src/
tests/
componentApp2/
src/
tests/

so the class in

suite/componentapp1/src/myclass.php [namespace: ComponentApp1\MyClass]

should have a suggested test path in

suite/componentapp1/tests/myclassTest.php [namespace: ComponentApp1\Tests\MyClass]

instead I get this

suite/componentapp1/tests/ComponentApp1/myclassTest.php [namespace: src\ComponentApp1\MyClass]
0

Please sign in to leave a comment.