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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marcoscano created an issue. See original summary.

msankhala’s picture

Here is the patch which replaces assertEquals with assertSame in MediaSourceTest.

Status: Needs review » Needs work
marcoscano’s picture

I guess when it's a translated text we would want to either keep using assertEquals() or to cast the translated text into a string.

pguillard’s picture

I guess this is more lisible to keep assertEquals()
So we get a mix of the two...

seanB’s picture

Title: Use assertSame() instead of assertEquals() in MediaSourceTest kernel test » Use assertSame() instead of assertEquals() in Media tests
FileSize
23.59 KB
2.2 KB
52.7 KB
29.13 KB

Added 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.

seanB’s picture

I did not mean to upload 2 versions of the patch with the same name, sorry about that!

Status: Needs review » Needs work

The last submitted patch, 6: 2983458-6.patch, failed testing. View results

pguillard’s picture

Status: Needs work » Needs review
FileSize
52.34 KB
1.64 KB

Last failing test solved

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Glorious. Thanks!

xjm’s picture

Version: 8.6.x-dev » 8.5.x-dev
Status: Reviewed & tested by the community » Needs work

I 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?

  • xjm committed 00f6554 on 8.6.x
    Issue #2983458 by seanB, pguillard, msankhala, marcoscano: Use...
Dinesh18’s picture

Status: Needs work » Needs review
FileSize
53.84 KB

Here is the patch for 8.5.x version.

Status: Needs review » Needs work

The last submitted patch, 13: 2983458-13.patch, failed testing. View results

seanB’s picture

Status: Needs work » Fixed

Not sure if we should actually focus our energy on backporting this with 8.6 already in the alpha phase. Let's just close this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.