Active
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Plan
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Mar 2019 at 08:50 UTC
Updated:
20 Feb 2025 at 07:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
claudiu.cristeaI use this script to discover such tests:
The script should run with
drush scr.It detects a lot of tests that are not to be converted. But still helps. To be improved.
Comment #3
claudiu.cristeaAdded #3041727: Convert ViewRenderTest into a Kernel test
Comment #4
claudiu.cristeaAdded #3041743: Convert ViewsTemplateTest into a Kernel test.
Comment #5
claudiu.cristeaAdded #3041755: Convert HandlerAllTest into a kernel test.
Comment #6
claudiu.cristeaAdded #3041765: Convert FieldGroupRowsTest into a Kernel test.
Comment #7
claudiu.cristeaAdded #3041770: Convert ArgumentStringTest into a Kernel test.
Comment #8
claudiu.cristeaAdded #3041778: Convert FilterEntityBundleTest into a kernel test.
Comment #9
claudiu.cristeaAdded #3041779: Convert LatestTranslationAffectedRevisionTest into a kernel test.
Comment #10
claudiu.cristeaAdded #3041786: Convert LatestRevisionFilterTest to a kernel test.
Comment #11
claudiu.cristeaAdded #3041790: Convert ViewsSqlExceptionTest to a kernel test.
Comment #12
claudiu.cristeaAdded #3041801: Convert StyleTest to a kernel test.
Comment #13
claudiu.cristeaAdded #3041816: Move UserMailNotifyTest under Kernel tests namespace.
Comment #14
claudiu.cristeaAdded #3041837: Convert UserDataTest into a kernel test.
Comment #15
amateescu commentedAdded #3041863: Convert a few node access tests from functional to kernel tests.
Comment #16
claudiu.cristeaAdded #3042472: Convert HandlerArgumentUserUidTest into a kernel test and clean up the surrounding code.
Comment #17
claudiu.cristeaAdded #3042536: Convert AccessPermissionTest into a Kernel test.
Comment #18
claudiu.cristeaAdded #3042538: Convert ArgumentDefaultTest into a kernel test.
Comment #19
claudiu.cristeaAdded #3042540: Convert user RelationshipRepresentativeNodeTest into a kernel test.
Comment #20
claudiu.cristeaAdded #3042869: Convert UpdateDeleteFileIfStaleTest into a Kernel test.
Comment #21
claudiu.cristeaAdded #3042872: Convert TaxonomyFieldTidTest into a Kernel test.
Comment #22
claudiu.cristeaComment #23
claudiu.cristeaAdded #3042875: Convert TaxonomyIndexTidFilterTest into a Kernel test.
Comment #24
claudiu.cristeaAdded #3042877: Convert ArgumentValidatorTermTest into a Kernel test.
Comment #25
claudiu.cristeaComment #26
claudiu.cristeaAdded #3042994: MailCaptureTest provides the same test coverage as AssertMailTraitTest and should be removed.
Comment #27
mile23New child: #2432647: Convert BlockTemplateSuggestionsTest into a KernelTestBase
Comment #28
mile23New child: #2664292: Convert Module\InstallTest into a Kernel test
Comment #29
feuerwagenMoved fixed issues to separate list.
Comment #30
claudiu.cristeaMoved fixed issues to Done.
Comment #31
claudiu.cristeaComment #32
claudiu.cristeaAdded #3045736: Convert ModuleInstallBatchTest into a Kernel test.
Comment #33
mile23New child: #2473681: Convert VocabularyCrudTest test to kernel test
Comment #34
claudiu.cristeaAdded #3046018: Convert SelectionTest into a Kernel test.
Comment #35
claudiu.cristeaComment #36
claudiu.cristeaAdded #3046171: Convert FilterCaptionTwigDebugTest into a Kernel test.
Comment #37
mile23New child with poetic name: #2695221: Remove ConfigFileContentTest and spread its ashes over ConfigCRUDTest and ConfigStorageTestBase
Comment #38
claudiu.cristeaAdded #3046281: Convert FilterUidRevisionTest into a Kernel test.
Comment #39
claudiu.cristeaAdded #3046377: Convert ContactFieldsTest into a Kernel test.
Comment #40
claudiu.cristeaAdded #3046382: Convert ConfigTranslationFormTest into a Kernel test.
Comment #41
claudiu.cristeaAdded #3046388: Convert LocaleStringTest into a Kernel test.
Comment #42
claudiu.cristeaAdded #3046392: Convert LocaleLibraryAlterTest into a Kernel test.
Comment #43
claudiu.cristeaAdded #3046393: Convert ConnectionFailureTest into a Kernel test.
Comment #44
claudiu.cristeaAdded #3046670: Move block content creation methods to a trait.
Comment #45
claudiu.cristeaComment #46
claudiu.cristeaAdded #3046676: Convert block_content RevisionRelationshipsTest into a Kernel test.
Comment #47
claudiu.cristeaAdded #3046680: Convert NewDefaultThemeBlocksTest into a Kernel test.
Comment #48
claudiu.cristeaAdded #3046682: Convert BlockContentValidationTest into a Kernel test.
Comment #49
claudiu.cristeaAdded #3046694: Convert BookInstallTest into a Kernel test.
Comment #50
claudiu.cristeaAdded #3046698: Convert BcRoutesTest into a Kernel test.
Comment #51
claudiu.cristeaAdded #3046723: Convert HandlerFieldFieldTest into a Kernel test.
Comment #52
claudiu.cristeaAdded #3046937: Convert TrackerUserUidTest into a Kernel test. Deprecate TrackerTestBase.
Comment #53
phenaproximaUpdating the IS to reflect some recent commits. :)
Comment #54
naveenvalechaAdded #3041813: Convert CacheTagTest into a kernel test
Comment #55
claudiu.cristeaComment #56
claudiu.cristeaComment #57
claudiu.cristeaAdded #3048423: Convert RelationshipUserFileDataTest into a Kernel test.
Comment #58
claudiu.cristeaComment #59
claudiu.cristeaAdded #3048434: Convert FileManagedAccessTest into a Kernel test.
Comment #60
claudiu.cristeaComment #61
claudiu.cristeaComment #62
claudiu.cristeaAdded #3049604: Convert CommentFieldNameTest into a Kernel test.
Comment #63
claudiu.cristeaAdded #3049612: Merge ArgumentUserUIDTest & FilterUserUIDTest and convert them into a Kernel test.
Comment #64
claudiu.cristeaAdded #3049637: Convert CommentUninstallTest into a Kernel test.
Comment #65
claudiu.cristeaComment #66
claudiu.cristeaAdded #3049685: Move MigrateNodeRevisionTest & NodeMigrateDeriverTest under the Kernel tests namespace.
Comment #67
claudiu.cristeaAdded #3049866: Convert HtmlToTextTest into a Unit test.
Comment #68
claudiu.cristeaAdded #3028712: Convert system MailTest into a Kernel test. Break its simpletest dependency.
Comment #69
claudiu.cristeaAdding #2035133: Convert system module's Mail unit test to phpunit. Seems that #3049866: Convert HtmlToTextTest into a Unit test is a duplicate.
Comment #70
claudiu.cristeaAdded #3050172: Move MigrateLanguageTest under Kernel tests namespace.
Comment #71
claudiu.cristeaAdded #3050353: \Drupal\Tests\system\Functional\Module\VersionTest could be a Kernel (or Unit) Test.
Comment #72
naveenvalechaUpdated IS. Moved the #3041842: Convert ArgumentValidateTest into a kernel test #3046937: Convert TrackerUserUidTest into a Kernel test. Deprecate TrackerTestBase to Done.
Comment #73
naveenvalechaUpdated IS
Comment #74
feuerwagenMore issues are done.
Comment #75
claudiu.cristeaMore issues are fixed.
Comment #76
feuerwagenGetting there
Comment #77
manuel garcia commented#3028712: Convert system MailTest into a Kernel test. Break its simpletest dependency got in :)
Comment #78
manuel garcia commentedWas about to open a new one for
DrupalDateTimeTestbut it ends up there's already an issue for it, so adding it to the list here: #2349453: Move \Drupal\Tests\system\Functional\Datetime\DrupalDateTimeTest::testTimezoneFormat into a Kernel testComment #79
krzysztof domańskiI added to issue summary #2742997: Convert CommentActionsTest to kernel test.
Comment #83
joachim commentedI think there's a lot of functional tests that make browser requests as part of setting up content types, fields and so on. Those could be converted to API calls.
I've added #3211229: Add an API-based equivalent to FieldUiTestTrait with similar methods as a child issue; I'll try to find time to create issues for tests where this can be converted.
Comment #84
longwaveWhile looking at #3048423: Convert RelationshipUserFileDataTest into a Kernel test I wondered if we can mark BTB tests as "risky" or similar if e.g. they do not perform a drupalGet(). This won't catch everything that strictly doesn't need it but that one and #2349453: Move \Drupal\Tests\system\Functional\Datetime\DrupalDateTimeTest::testTimezoneFormat into a Kernel test for starters would be picked up.
Comment #85
longwaveA test patch for #84, this causes functional tests that do not perform HTTP requests to fail.
Comment #89
joachim commentedAdded issue summary from a duplicate I accidentally created today, & related issue for doing setup with API calls.
Comment #90
joachim commentedComment #91
claudiu.cristeaUpdating IS to account that #3035518: Convert ImageEffectsTest & ToolkitTest into Kernel tests, #3048423: Convert RelationshipUserFileDataTest into a Kernel test and #2742997: Convert CommentActionsTest to kernel test are fixed.
Comment #92
joachim commentedComment #95
mglamanI have stopped writing Functional tests and always use Kernel tests.
Here’s a bunch of examples I’ve done: https://git.drupalcode.org/project/google_tag/-/tree/2.0.x/tests/src/Ker...
It handles requests by passing it to the HTTP kernel. The above even tests user register and login.
That code is based on a personal library I use: https://github.com/mglaman/drupal-test-helpers
Comment #96
joachim commentedComment #97
joachim commentedFound a few more.
Sniff: calling $container->set() in a browser test is a dead giveaway -- it will have no effect on the SUT since that is getting the service container from cache or building it from YAML files!
Comment #98
catchComment #99
catchComment #100
catchFormElementsLabelTest is a potential candidate here - at least the last method does not http requests.
Comment #101
quietone commented