title: How to generate Tests in tests/ directory in PhpStorm?
body: <p>PhpStorm has some sort of weird behaviour that is driving me crazy. I've got my project setup to have a <code>source</code> and a <code>test</code> directory. The <code>source</code> directory should be for productive code, while the <code>test</code> directory should contain all the phpunit tests. </p>
  
  <p>In those directories, the folder structure is mirrored - if I have a class <code>\foo\Bar</code>, 
  then there is
  <code>src/foo/Bar.php</code> and <code>test/foo/BarTest.php</code>. </p>
  
  <p>I've marked <code>src/</code> and <code>test/</code> as source and test directory in PhpStorm, however, every time I want to create a new test suite for a class, PhpStorm defaults to put the test class into the <code>src/</code> directory next to the class under test.</p>
  
  <p>It's possible to change that, however it get's more annoying when that same directory in <code>test/</code> does not exist yet. Instead of creating it, PhpStorm will just reject to create that test suite for me. </p>
  
  <p>Maybe I am misunderstanding the concept behind test management in PhpStorm quite a bit - because it just can't be that bad user experience. </p>
  
  <p>Is there something I am doing wrong, or something that I can configure to make the situation less painful?</p>