title: Composer: How to recursively autoload subfolders in /src
body: <p>I'm writing some tests for a composer package, but i cannot load classes in subfolders of /src.</p>
  
  <p>My folder structure</p>
  
  <pre><code>root
   - src
     - file1.php
     - folder1
       - folder2
         - file2.php
   - tests
  </code></pre>
  
  <p>The tests' folder structure reflects the one of src.</p>
  
  <p>In my composer.json i've:</p>
  
  <pre><code>{
      "autoload": {
          "psr-4": {
              "Namespace1\\\Package_Namespace\\\": "src"
          }
      }
  }
  </code></pre>
  
  <p>Now, when i launch the tests, only the ones in src can well include their own classes, while the ones that use the classes in subfolders can't (for example, file2.php is never loaded).</p>
  
  <p>I've tried also to explicitly specify the subfolders in composer.json file, but it seems not working.</p>
  
  <p>I hope someone can help me. If you need more info, please let me know and i'll provide them.</p>
  
  <p>Thank you and i wish you a merry Christmas!</p>