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.
Problem/Motivation
All kernel tests are PHPUnit tests and therefore must live in tests/src/Kernel, not in the old Simpletest location src/Tests.
modules/system/src/Tests/Common/SystemListingTest.php:13:class SystemListingTest extends KernelTestBase {
modules/system/src/Tests/Common/PageRenderTest.php:12:class PageRenderTest extends KernelTestBase {
modules/system/src/Tests/Cache/GenericCacheBackendUnitTestBase.php:22:abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
modules/system/src/Tests/Entity/EntityUnitTestBase.php:16:abstract class EntityUnitTestBase extends KernelTestBase {
modules/views/src/Tests/ViewKernelTestBase.php:20:abstract class ViewKernelTestBase extends KernelTestBase {
modules/simpletest/src/Tests/KernelTestBaseTest.php:16:class KernelTestBaseTest extends KernelTestBase {
modules/serialization/src/Tests/NormalizerTestBase.php:9:abstract class NormalizerTestBase extends KernelTestBase {
Proposed resolution
Move the kernel tests to their correct location. Keep base classes at their old location, but deprecate them.
Remaining tasks
Patch.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#11 | interdiff.txt | 1.98 KB | claudiu.cristea |
#11 | 2798097-11.patch | 5.97 KB | claudiu.cristea |
Comments
Comment #2
klausiPatch. The remaining files are all base classes that all have an @deprecated tag now:
Comment #3
klausiOops, fixed 1 @deprecated comment.
Comment #4
claudiu.cristeaLooks good
Comment #5
dawehnerThis move is wrong. This is testing the old kernel test, so it should stay there.
Comment #6
klausiGood catch, I completely forgot about the old kernel test base. Let's remove it in #2734663: Update deprecation message for old KernelTestBase in simpletest.
Comment #7
dawehnerLooks great now!
Comment #9
klausiRandom test fail, back to RTBC.
Comment #10
alexpottCan this extend from the new class so we are not maintaining duplicate code?
Comment #11
claudiu.cristeaAddressing #10.
Comment #12
naveenvalechalooks good to go.
Comment #13
alexpottAs this is only touching tests and leave the base test classes in place and deprecated committed to 8.2.x as well as 8.3.x.
Committed and pushed 0fe04b1 to 8.3.x and 6a8aa90 to 8.2.x. Thanks!