-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conversation
Fixes #855
<directory>src/*/*Bundle/Tests</directory> | ||
<directory>src/*/Bundle/*Bundle/Tests</directory> | ||
<directory>src/*Bundle/Tests</directory> | ||
<directory>tests/*</directory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests
is enough actually
no need for a |
We may also have to change the sensiolabs/SensioGeneratorBundle |
Looks good to me, the choice of |
@@ -1,6 +1,6 @@ | |||
<?php | |||
|
|||
namespace AppBundle\Tests\Controller; | |||
namespace Tests\Controller; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have put that into AppBundle
instead: Tests\AppBundle\Controller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The autoload-dev does not match the test namespace. |
@@ -6,6 +6,9 @@ | |||
"autoload": { | |||
"psr-4": { "": "src/" } | |||
}, | |||
"autoload-dev": { | |||
"psr-4": { "Tests\\": "tests/" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use AppBundle\\Tests\\
here so that we can keep using the AppBundle\Tests
namespace prefix in the test classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if you define multiple bundles, this would make it harder to follow the structure (you would have to change the structure of the testsuite)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know... Forcing the namespace to Tests
instead of an empty one sounds better to me because there should not be any other thing than tests.
If we wanted to use AppBundle\Tests
it would need the PSR-4 to be { "" : "test/" }
and we could put almost anything in it.
Plus, the bundle structure is merely optional, even if @fabpot advised adding it.
At first I prepared the structure as tests/Controller/DefaultControllerTest.php
because here we have the whole application tests, and the bundle structure seemed less important to me than the tests we may add in it.
👍 good to merge IMO The remaining thing already has an issue on sensiolabs/SensioGeneratorBundle#416 |
I share @stof's concern: I recommend the single bundle approach, but I also think adding multiple bundles shouldn't require reworking your structure. |
@weaverryan What would you have to change in a multiple-bundle approach? |
@fabpot nevermind - I don't know what I was looking at. |
Thank you @Pierstoval. |
Fixes #855