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.
As of Drupal 8.9, contrib database drivers are allowed to reside within a module. The KernelTestBase ensures that the main bootstrap.inc file Is included for kernel tests. One of the functions in the bootstrap is called when contrib drivers connection namespace is being resolved by core. This moving the call to parent::setup() to the top of the test’s setup.
Comment | File | Size | Author |
---|---|---|---|
#17 | 3152003-17.patch | 1.12 KB | sanjayk |
#2 | 3152003-2.patch | 1.11 KB | Beakerboy |
Comments
Comment #2
BeakerboyPatch for this issue
Comment #3
daffie CreditAttribution: daffie commentedThe code of this patch comes from my own patch from #3128699: Testing issue for pgsql_fallback.
Comment #4
BeakerboyComment #5
alexpott@Beakerboy does #3151118: Include bootstrap.inc using composer fix this for you?
Comment #6
Beakerboy@alexpott No, that causes massive, across the board failures:
Drupal\KernelTests\Core\Database\SelectSubqueryTest::testFromSubquerySelect
Error: Call to undefined function Drupal\Core\drupal_valid_test_ua()
/home/travis/build/Beakerboy/drupal-project/core/lib/Drupal/Core/DrupalKernel.php:378
/home/travis/build/Beakerboy/drupal-project/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php:190
/home/travis/build/Beakerboy/drupal-project/core/lib/Drupal/Core/Database/Database.php:582
/home/travis/build/Beakerboy/drupal-project/core/lib/Drupal/Core/Database/Database.php:483
/home/travis/build/Beakerboy/drupal-project/core/tests/Drupal/KernelTests/KernelTestBase.php:436
1351/home/travis/build/Beakerboy/drupal-project/core/tests/Drupal/KernelTests/KernelTestBase.php:260
/home/travis/build/Beakerboy/drupal-project/core/tests/Drupal/KernelTests/KernelTestBase.php:240
/home/travis/build/Beakerboy/drupal-project/core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php:26
/home/travis/build/Beakerboy/drupal-project/vendor/phpunit/phpunit/src/Framework/TestResult.php:691
Comment #7
alexpott@Beakerboy
did you remove vendor anddo a composer install... #6 looks like you did not.Edit: I think you only need to run composer install again to rebuild the autoloader.
Comment #8
BeakerboyI have a bash script where I list all the patches that need to be applied for the repository. It runs that after the composer install. After applying this patch earlier in my sequence instead, before the composer install, the remaining "Call to undefined function Drupal\Core\drupal_valid_test_ua()" Errors are gone. However, your patch is for D9 while this is for D8.9. Thanks.
Comment #9
alexpott@Beakerboy so #8 didn't make it clear whether #3151118: Include bootstrap.inc using composer did actually fix this issue. Does it?
Comment #10
BeakerboyDrupal 9 has fewer "Call to undefined function Drupal\Core\drupal_valid_test_ua()" errors than D8.9. Your patch fixes the leftovers that were not fixed by some other means.
This patch is for D8 though.
Comment #11
alexpottIndeed and we need a D9 version of this first - this needs to land in 9.1.x and 9.0.x too.
Comment #12
BeakerboyAre planning on porting your patch to Drupal 8.9? If so, that would render this issue here moot and it could be closed, right?
Comment #13
daffie CreditAttribution: daffie commentedNeeds an reroll for 9.1 and 9.0.
Comment #14
BeakerboyWhen I said “some other means” in #10, I was not referring to “this” issue. There is some unknown-to-me reason that fixed a bunch of them in D9. I have not ported this simple fix to D9, and I don’t know why I should if the patch by @alexpott is the preferred fix. Can someone please explain why this issue needs to be ported to D9? If the standard protocol is to patch D9.1 and back port previous Drupal versions from there, then great. I just would like to know why this is necessary.
Comment #15
alexpott@Beakerboy I think that #3151118: Include bootstrap.inc using composer will only land in 9.1.x - so let's go ahead with this one - and backport to 8.9.x once both patches are ready.
Comment #16
sanjayk CreditAttribution: sanjayk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #17
sanjayk CreditAttribution: sanjayk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedReroll the patch for d9.1.0-dev
Comment #18
daffie CreditAttribution: daffie commentedRerolled for Drupal 9.0 and 9.1.
Back to RTBC.
Comment #19
alexpottCommitted and pushed c71e7e4e57 to 9.1.x and 68cb6a2033 to 9.0.x. Thanks!
Committed d31a8c6 and pushed to 8.9.x. Thanks!
This comment contains a spelling mistake and is not that important here.
So I rewrote it and moved it on commit:
Because it really applies to the call in the class_exists() check.