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.
Follow-up to #2870441: Convert web tests to browser tests for content_translation module
See #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase)
Lists of tests to convert
Out of Scope
\Drupal\content_translation\Tests\ContentTranslationContextualLinksTest
\Drupal\content_translation\Tests\ContentTranslationWorkflowsTest
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff-5-7.txt | 765 bytes | Anonymous (not verified) |
#7 | 2887813-7.patch | 7.29 KB | Anonymous (not verified) |
Comments
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedLet's do it!)
Using a black box instead of parsing json response seems fair solution.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #6
LendudeAnother great conversion @vaplas!
awesome that we can get rid of that!
This can just be {@inheritdoc}, but that can probably be fixed on commit.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks!
#6.2: Indeed!
FunctionalJavascript/ContentTranslationContextualLinksTest.php
is a new test and we don't need to copy the flaws from old test. Fixed.Comment #8
xjmThanks @vaplas for fixing that. In general, I'd really like it if we not ask committers to fix things on commit. Providing a correct patch is always better, and committers might miss the comment, or it might mess up their workflows, and it bypasses the review process.
Comment #9
xjmI think it's just part 2, not part -2 (what does that even mean?). ;) So fixing the title for the commit message. :)
Comment #11
xjmIt's awesome to be able to get rid of this icky method.
I briefly asked myself whether this was too disruptive for a patch release. Generally we prefer to only break
@internal
APIs in minors, and tests that were subclassingContentTranslationContextualLinksTest
could have been relying on this method. I think that's highly unlikely, though, since it's not a base class. (Sometimes we deliberately subclass non-base classes to run their methods in child tests, but it's quite an edgecase.)Since the disruption of not backporting these fixes is also fairly high (makes fixing actual bugs harder), I went ahead and backported it as well. So committed to 8.5.x and 8.4.x. Thanks!
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedThank you, @xjm! Absolutely!
During the removal of the method, I was not at ease with my heart, because:
But the more I looked at this method, the greater the preponderance of the following arguments:
but this is not so long ago (from 11.09.2013, after #2074037: Add drupalPostUrl() — drupalPost()/drupalPostAjax() are for forms only, D8 JS performs non-form HTTP requests).
In other words, a simple js-test that verifies the final result (black-box testing) seems much more efficient.
Thanks for understanding again! 🎉
Comment #14
Lendude@xjm thanks for committing! I'll bump it back to needs work next time, you are right of course that leaving stuff for the committers to fix is just the wrong mentality. It won't happen again! :)