- Issue created by @joachim
- First commit to issue fork.
- Status changed to Needs work
10 months ago 10:42pm 5 February 2024 - ๐ฆ๐บAustralia mstrelan
Added some formatting to the IS. Opened an MR to get the ball rolling.
- Moved
Drupal\Core\Test\FunctionalTestSetupTrait
to\Drupal\Tests\FunctionalTestSetupTrait
. Arguably it could go inDrupal\Tests\Traits
but it's not clear when to use that and when not to. It could also go inDrupal\FunctionalTests
but it's also used by\Drupal\TestSite\Commands\TestSiteInstallCommand
so I don't know if a more generic namespace is better. - Moved
Drupal\Core\Test\RefreshVariablesTrait
toDrupal\Tests\RefreshVariablesTrait
. Again, it could go inDrupal\Tests\Traits
but it seems logical to put it next toUiHelperTrait
.
- Moved
- Merge request !6461Resolve #3383801 "move things from lib/Drupal/Core/Test to core/tests" โ (Open) created by mstrelan
- Status changed to Needs review
10 months ago 1:43am 6 February 2024 - ๐ฆ๐บAustralia mstrelan
I think it's just these three that can move.
- \Drupal\Core\Test\AssertMailTrait
- \Drupal\Core\Test\FunctionalTestSetupTrait
- \Drupal\Core\Test\RefreshVariablesTrait
- ๐ฌ๐งUnited Kingdom catch
Directly in Drupal\Tests seems OK, we already have lots of traits in there as you point out.
- ๐บ๐ธUnited States mile23 Seattle, WA
I wonder how many contrib tests will break because there aren't deprecated sub-traits remaining... Also DTT might have to do a re-organize.
Arguably it could go in Drupal\Tests\Traits but it's not clear when to use that and when not to.
The Traits namespace is there so we can limit the number of autoloaded test files per framework. Since some frameworks share traits, we put them in a separate directory so we can autoload them without autoloading everything else. This only applies to modules, AFAICR. https://git.drupalcode.org/project/drupal/-/blob/11.x/core/tests/bootstr... See also TestSuiteBase and its subclasses. https://git.drupalcode.org/project/drupal/-/blob/11.x/core/tests/TestSui...
It might help us to do the same thing for non-module core, but I doubt it.
- ๐ฆ๐บAustralia mstrelan
Added a deprecated version of AssertMailTrait, if that looks right I'll add a CR and deprecate the others too. Do we need deprecation tests then too?
- Status changed to Needs work
10 months ago 3:22pm 13 February 2024 - ๐บ๐ธUnited States smustgrave
Believe we need a CR for the deprecations vs pointing to the ticket
- ๐ฆ๐บAustralia mstrelan
Seeking feedback on #9 but will probably just go ahead with the others.