Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JeroenT’s picture

JeroenT’s picture

Issue tags: +drupaldevdays
Mile23’s picture

Status: Needs review » Needs work
Issue tags: +@deprecated

Patch still applies. :-)

+++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php
@@ -242,7 +242,7 @@ function testStyle() {
-    $style = entity_load_unchanged('image_style', $style->id());
+    $style = \Drupal::entityManager()->getStorage('image_style')->loadUnchanged($style->id());

EntityManager is deprecated: https://www.drupal.org/node/2549139

Also, we want to use $this->container in simpletest, instead of \Drupal for service location.

So something like:

$entity_type_manager = $this->container->get('entity_type.manager');
$style = $entity_type_manager->getStorage('image_style')->loadUnchanged($style->id());
Devaraj johnson’s picture

I have updated the patch have a look

Devaraj johnson’s picture

Status: Needs work » Needs review
Mile23’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thanks.

I checked and the patch applies against 8.0.x and 8.1.x, so if this is the wrong branch for this issue then it can just swap out.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Since this is test only I think it's fine for both branches. Committed/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!

  • catch committed 090ae73 on 8.1.x
    Issue #2471593 by JeroenT, Devaraj johnson: Replace the use of...

  • catch committed 4e20be2 on 8.0.x
    Issue #2471593 by JeroenT, Devaraj johnson: Replace the use of...

Status: Fixed » Closed (fixed)

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