Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I noticed in #1935922: Convert PhpStorage tests to phpunit it's doing a lot of this:
/**
* @file
- * Definition of Drupal\system\Tests\PhpStorage\FileStorageTest.
+ * Definition of Drupal\Tests\Component\PhpStorage\FileStorageTest.
*/
-namespace Drupal\system\Tests\PhpStorage;
+namespace Drupal\Tests\Component\PhpStorage;
Right now, we're only doing this for PHPUnit tests, but it probably makes sense to do this for all tests.
Comments
Comment #1
msonnabaum CreditAttribution: msonnabaum commentedI'm good with this if we want to do it. As I pointed out in the original PHPUnit issue, our move into the lib namespace was misguided, so it probably makes sense to move them all back to core/tests.
Comment #2
Crell CreditAttribution: Crell commentedAs long as we're still loading test classes with the same PSR-0-capable class loader as everything else, I don't really care enough to debate it either way.
Moving /core/lib tests out of system module, though, does generally bring a smile to my face.
Comment #3
dawehnerWhat is the proper placement for tests?
There is Drupal\Tests\Component\FooTest
and
Drupal\system\Tests\BarTest
Comment #4
BerdirHm, I'd say yes, but by converting them to PHPUnit, which is going to be a long term task :)
The current system actually seems to be a nice separation and makes it obvious what's still a Simpletest test. Moving them now would break an insane amount of patches, at a time where we can't afford that IMHO.
Comment #9
Mile23Here's what we ended up doing: https://www.drupal.org/docs/8/phpunit/phpunit-file-structure-namespace-a...
Calling this outdated.