Remove depreciated methods and unused imports in code base.

Comments

heykarthikwithu created an issue. See original summary.

heykarthikwithu’s picture

Assigned: heykarthikwithu » Unassigned
Status: Active » Needs review
StatusFileSize
new3.72 KB

Removed the depreciated methods and unused imports in code base.

bojanz’s picture

Status: Needs review » Needs work

Thanks!

+    $values = array(
+     'targetEntityType' => $this->entityType,
+      'bundle' => $this->bundle,
+      'mode' => 'default',
+      'status' => TRUE,
+    );
+    $this->display = \Drupal::entityTypeManager()->getStorage($this->entityType)->create($values);

We don't use array() anymore, only short array syntax.
You are passing the wrong entity type to getStorage(), so the test doesn't pass. Needs to be "entity_view_display".
Run the test once you've made the change to confirm.

heykarthikwithu’s picture

Status: Needs work » Needs review
StatusFileSize
new3.72 KB
new812 bytes
heykarthikwithu’s picture

Issue tags: +Quick fix
bojanz’s picture

Status: Needs review » Fixed
-use Drupal\simpletest\KernelTestBase;
+use Drupal\KernelTests\KernelTestBase;

You swapped the base test class for a completely different one (don't let the name fool you). Lost an hour of undercaffeinated time chasing weird test fails because of this :(

Fixed, and committed.

  • bojanz committed 58b19a1 on 8.x-1.x authored by heykarthikwithu
    Issue #2639072 by heykarthikwithu: Remove depreciated methods and unused...

Status: Fixed » Closed (fixed)

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