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.
Comment | File | Size | Author |
---|---|---|---|
#16 | 3097892-11.patch | 33.8 KB | mondrake |
Comment | File | Size | Author |
---|---|---|---|
#16 | 3097892-11.patch | 33.8 KB | mondrake |
Comments
Comment #2
longwaveComment #4
mondrakeWe cannot remove
PhpunitCompatibilityTrait
yet because theassertEquals
override implemented in thePhpunitVersionDependentTestCompatibilityTrait
s is still needed.I see 3 options:
PhpunitCompatibilityTrait
andPhpunitVersionDependentTestCompatibilityTrait
s still leaving an emptyPhpunitCompatibilityTrait
that just usesPhpunitVersionDependentTestCompatibilityTrait
PhpunitCompatibilityTrait
and make tests usePhpunitVersionDependentTestCompatibilityTrait
directly when neededComment #5
longwaveThe PHPUnit 4 bridge code in core/tests/bootstrap.php can be removed here too, I think.
Comment #6
mondrake#5 +1
Edit: actually there is #3063182: Remove PHPUnit 4.8 class aliasing BC layer for that
Comment #7
mondrakeComment #8
longwave#3082340: Replace assertEquals() overrides in PHPUnit Kernel, Functional and FunctionalJavascript tests with a MarkupInterfaceComparator implementation is in so let's try again. Missed some of the PHPUnit compatibility stuff before, so some additions in this patch.
Comment #10
mondrakeOn this.
Comment #11
mondrakeMore removals / fixes.
Comment #12
mondrakeSome more leftovers.
Comment #13
longwaveI don't think these should be removed until Drupal 10 (even if the trigger_error() says Drupal 9) as these were un-deprecated in #3031580: Undeprecate \Drupal\FunctionalTests\AssertLegacyTrait and \Drupal\KernelTests\AssertLegacyTrait in Drupal 8
Comment #14
mondrakeAha so those are needed for running Simpletest tests... I guess we need to remove the trigger_errors for now, then, to avoid such confusion. Bad chance it was not done in the other issue.
edit - we need to remove the expected deprecation in tests, too
Comment #15
mondrakeDoing #14 or whatever it needs there can be controversial, so I propose to tackle that separately. Re-uploading #11, which is good to go IMO
Comment #16
mondrakeComment #17
Berdir> Aha so those are needed for running Simpletest tests...
No, not for simpletest tests. For tests that have been converted from simpletest to phpunit without updating all those asserts. It was decided to push the deprecation back to D10 as the cost if keeping it is low and the amount of calls to those is massive.
Bunch of comments below, but nothing actionable, just some notes, so I think this is ready. Kind of expected this to remove old simpletest base classes in modules, but this is just about the testing component, makes sense.
Ah, these are legacy tests, that's why our @trigger_error() was ignored.
Thought about using assertInstanceOf but this will go away anyway in #3087644: Remove Drupal 8 updates up to and including 88**
I've been wondering about this, I still don't get what will happen exactly now as we just remove the deprecation message without any actual BC code? I have a case in a project with a very complex kernel test where I need to install config before enabling another module, I guess I'll see what will happen.
not sure if this should be removed together with the other install profile stuff instead in #2831065: Remove BC layer from \Drupal\Core\DrupalKernel::getInstallProfile() but I guess here is fine too, unless other parts of that, this isn't blocked.
Comment #18
mondrakeFiled #3104372: Fix Drupal\FunctionalTests\AssertLegacyTrait inconsistent deprecation messages.
Comment #20
mondrakeRandom test failure
Comment #21
larowlanDo we have an issue for removing \Drupal\system\Tests\Update\UpdatePathTestBase?
Comment #22
longwave@larowlan: patch in #3097453: Remove system.module BC layers covers that
Comment #23
larowlanApplied this patch locally, and grepped for 'deprecated' and 'trigger_error' in classes matching *TestBase in /core/tests and only found the javascript deprecation handling in WebDriverTestBase, which is not legacy.
Adding issue credits
Comment #24
larowlanFixed on commit
Committed 62afe77 and pushed to 9.0.x. Thanks!
Comment #27
mradcliffeSo \Drupal\Tests\PhpunitCompatibilityTrait as a whole did not have a deprecation and the comments in the methods that WERE deprecated said to use the same trait but with the createMock method. Which, ironically, doesn't exist.
This caused my contrib module tests to break in 9.0.x. I think because the traits themselves didn't have @deprecated so these wouldn't have been caught by deprecated warnings.
This should have a Change record to mention the removed traits and what should be done instead.
The change record at https://www.drupal.org/node/2907725 doesn't mention this.
Comment #28
mradcliffeHere's a draft change record: https://www.drupal.org/node/3112189
I linked to the change records for the @deprecated methods.
What brought me here and what was most confusing is that the PhpunitCompatibilityTrait deprecation is wrong and suggests that there is a createMock method available on that trait. It's not. It's on PHPUnit\Framework\TestCase directly. It may have existed, but I haven't dug that far into git history.
I'll update the change record related to PhpunitCompatibilityTrait::createMock once I dig into the history to find the issue that removed createMock or if it never existed at all.
Comment #29
quietone CreditAttribution: quietone commentedRemoving tag because this has a change record.