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
Spun off from #2878119: Whether queued or not, update the media thumbnail and metadata before beginning the entity save database transaction
It was suggested there to replace ::assertEquals()
with ::assertSame()
in some of the assertions. Let's do the replacement in the whole test here, which will make the resulting code clearer and more robust at the same time.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#13 | 2983458-13.patch | 53.84 KB | Dinesh18 |
#9 | iterdiff-2983458-6-9.txt | 1.64 KB | pguillard |
#9 | 2983458-9.patch | 52.34 KB | pguillard |
#6 | interdiff-5-6.txt | 29.13 KB | seanB |
#6 | 2983458-6.patch | 52.7 KB | seanB |
Comments
Comment #2
msankhala CreditAttribution: msankhala as a volunteer and at Material commentedHere is the patch which replaces assertEquals with assertSame in MediaSourceTest.
Comment #4
marcoscanoI guess when it's a translated text we would want to either keep using assertEquals() or to cast the translated text into a string.
Comment #5
pguillard CreditAttribution: pguillard commentedI guess this is more lisible to keep assertEquals()
So we get a mix of the two...
Comment #6
seanBAdded back some places where we could still use assertSame in
Drupal\Tests\media\Kernel\MediaSourceTest
. And why not fix it in other tests as well while we're at it.Comment #7
seanBI did not mean to upload 2 versions of the patch with the same name, sorry about that!
Comment #9
pguillard CreditAttribution: pguillard commentedLast failing test solved
Comment #10
phenaproximaGlorious. Thanks!
Comment #11
xjmI reviewed the patch and scope with a
git diff --staged --color-words
.Committed and pushed to 8.6.x. Thanks!
The patch doesn't cherry-pick cleanly to 8.5.x. Should we create an 8.5.x version, to minimize merge conflicts in backports?
Comment #13
Dinesh18 CreditAttribution: Dinesh18 as a volunteer commentedHere is the patch for 8.5.x version.
Comment #15
seanBNot sure if we should actually focus our energy on backporting this with 8.6 already in the alpha phase. Let's just close this.