Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rocket.man created an issue. See original summary.

bkhandruk’s picture

Assigned: bkhandruk » Unassigned
Status: Active » Needs review
FileSize
9.16 KB

Replaced all deprecated usages in module.

woprrr’s picture

Status: Needs review » Needs work
+++ b/src/Form/CropTypeForm.php
@@ -176,7 +177,7 @@ class CropTypeForm extends EntityForm {
+      $context = array_merge($t_args, array('link' => Link::fromTextAndUrl(t('View'), new Url('crop.overview_types'))));

That would be better to use Link::createFromRoute($this->t('View'), 'crop.overview_types'); instead of fromTextAndUrl().

+++ b/tests/src/Kernel/CropCRUDTest.php
@@ -40,7 +40,7 @@ class CropCRUDTest extends CropUnitTestBase {
+      self::assertEquals($loaded[$key], $value, new FormattableMarkup('Correct value for @field found.', ['@field' => $key]));

@@ -91,11 +91,11 @@ class CropCRUDTest extends CropUnitTestBase {
+          self::assertEquals($loaded_crop->{$key}->target_id, $value, new FormattableMarkup('Correct value for @field found.', ['@field' => $key]));
...
+          self::assertEquals($loaded_crop->{$key}->value, $value, new FormattableMarkup('Correct value for @field found.', ['@field' => $key]));

+++ b/tests/src/Kernel/CropEntityProvidersTest.php
@@ -58,7 +58,7 @@ class CropEntityProvidersTest extends CropUnitTestBase {
+    self::assertEquals($provider->uri($file), $file->getFileUri(), 'File provider plugin returned correct URI.');

You don't need to change that. Why ? because now have her native implementation of assertEquals() instead KernelTestBase.

IDE show deprecated because KernelTestBase use an deprecated AssertLegacyTrait we need to delete it and use $this->assertEqual of KernelTestBase.

bkhandruk’s picture

Thanks, @woprrr. Corrected link creation and assertion uses. The only thing I've made different from #3 is changed $this->assertEqual (trait method) to $this->assertEquals (KernelTestBase method).

bkhandruk’s picture

Status: Needs work » Needs review
woprrr’s picture

That look Ok to me :) Thanks for our job @rocket.man ;)

woprrr’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +DevDaysSeville

  • woprrr committed d2ee20c on 8.x-1.x authored by rocket.man
    Issue #2855792 by rocket.man, woprrr: Replace all of deprecated usages
    
woprrr’s picture

Status: Reviewed & tested by the community » Fixed

Merged Thank You for good job.

Status: Fixed » Closed (fixed)

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