23x: Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
    1x in PaymentMethodTest::testAdd from Drupal\Tests\payment\Functional\Controller
    1x in PaymentAdministrationCategoryWebTest::testOverview from Drupal\Tests\payment\Functional
    1x in ModuleInstallUninstallWebTest::testInstallationAndUninstallation from Drupal\Tests\payment\Functional
    1x in PaymentStorageWebTest::testCRUD from Drupal\Tests\payment\Functional\Entity\Payment
    1x in PaymentLineItemsInputWebTest::testElement from Drupal\Tests\payment\Functional\Element
    1x in PaymentTypeWebTest::testOverview from Drupal\Tests\payment\Functional\Controller
    1x in PaymentTest::testPaymentUi from Drupal\Tests\payment\Functional\Controller
    1x in PaymentStatusWebTest::testDelete from Drupal\Tests\payment\Functional\Controller
    1x in PaymentStatusWebTest::testAdd from Drupal\Tests\payment\Functional\Controller
    1x in PaymentStatusWebTest::testList from Drupal\Tests\payment\Functional\Controller
    1x in PaymentMethodTest::testAddSelect from Drupal\Tests\payment\Functional\Controller
    1x in PaymentFormWebTest::testFormatter from Drupal\Tests\payment_form\Functional\Plugin\Field\FieldFormatter
    1x in PaymentMethodTest::testDelete from Drupal\Tests\payment\Functional\Controller
    1x in PaymentMethodTest::testDuplicate from Drupal\Tests\payment\Functional\Controller
    1x in PaymentMethodTest::testEnableDisable from Drupal\Tests\payment\Functional\Controller
    1x in PaymentMethodTest::testList from Drupal\Tests\payment\Functional\Controller
    1x in PaymentReferenceWebTest::testWidget from Drupal\Tests\payment_reference\Functional\Plugin\Field\FieldWidget
    1x in PaymentReferenceWebTest::testFieldCreation from Drupal\Tests\payment_reference\Functional\Plugin\Field\FieldType
    1x in PaymentReferenceWebTest::testField from Drupal\Tests\payment_reference\Functional\Plugin\Field\FieldType
    1x in PaymentReferenceWebTest::testElement from Drupal\Tests\payment_reference\Functional\Element
    1x in PaymentFormWebTest::testWidget from Drupal\Tests\payment_form\Functional\Plugin\Field\FieldWidget
    1x in PaymentFormWebTest::testField from Drupal\Tests\payment_form\Functional\Plugin\Field\FieldType
    1x in BasicWebTest::testConfigurationForm from Drupal\Tests\payment\Functional\Plugin\Payment\LineItem

  2x: entity_get_form_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service('entity_display.repository')->getFormDisplay() instead. See https://www.drupal.org/node/2835616
    1x in PaymentReferenceWebTest::testElement from Drupal\Tests\payment_reference\Functional\Element
    1x in PaymentReferenceWebTest::testWidget from Drupal\Tests\payment_reference\Functional\Plugin\Field\FieldWidget

  2x: Support for asserting against non-boolean values in ::assertTrue is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use a different assert method, for example, ::assertNotEmpty(). See https://www.drupal.org/node/3082086
    1x in PaymentStorageWebTest::testCRUD from Drupal\Tests\payment\Functional\Entity\Payment
    1x in PaymentUnitTest::testGetLineItems from Drupal\Tests\payment\Kernel

  1x: entity_get_display() is deprecated in drupal:8.8.0. It will be removed before drupal:9.0.0. Use \Drupal::service('entity_display.repository')->getViewDisplay() instead. See https://www.drupal.org/node/2835616
    1x in PaymentFormWebTest::testFormatter from Drupal\Tests\payment_form\Functional\Plugin\Field\FieldFormatter

  1x: Support for asserting against non-boolean values in ::assertFalse is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use a different assert method, for example, ::assertEmpty(). See https://www.drupal.org/node/3082086
    1x in PaymentStorageWebTest::testCRUD from Drupal\Tests\payment\Functional\Entity\Payment

  1x: \Drupal\Tests\PhpunitCompatibilityTrait:setExpectedException() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Backward compatibility for PHPUnit 4 will no longer be supported. See https://www.drupal.org/node/3056869
    1x in ConfigurePaymentTypeTest::testExecute from Drupal\Tests\payment\Unit\Controller

Comments

Berdir created an issue. See original summary.

gnanagowthaman sankar’s picture

Hi @Berdir,

Here by i attached the patch, Please review and let me know for any changes.

Thanks & Regards,
Gnanagowthaman sankar

gnanagowthaman sankar’s picture

Status: Active » Needs review
StatusFileSize
new11.89 KB

Patch

Thanks & Regards,
Gnanagowthaman sankar

berdir’s picture

Status: Needs review » Needs work

Thanks for starting this. Some small comments.

  1. +++ b/tests/src/Functional/Entity/Payment/PaymentStorageWebTest.php
    @@ -36,25 +41,25 @@ class PaymentStorageWebTest extends BrowserTestBase {
         $payment->getPaymentType()->setConfiguration($payment_type_configuration);
    -    $this->assertTrue($payment instanceof PaymentInterface);
    +    $this->assertNotEmpty($payment instanceof PaymentInterface);
         // @todo The ID should be an integer, but for some reason the entity field
         //   API returns a string.
    -    $this->assertTrue(is_numeric($payment->getOwnerId()));
    +    $this->assertNotEmpty(is_numeric($payment->getOwnerId()));
         $this->assertEqual(count($payment->validate()), 0);
    -    $this->assertTrue($payment->getPaymentType() instanceof PaymentTypeInterface);
    +    $this->assertNotEmpty($payment->getPaymentType() instanceof PaymentTypeInterface);
     
    

    It's not necessary to replace all assertTrue(), just those that aren't asserting an actual boolean. But the inst isntanceof cases could be replaced with asertInstanceOf I think it is called.

  2. +++ b/tests/src/Functional/Entity/Payment/PaymentStorageWebTest.php
    @@ -36,25 +41,25 @@ class PaymentStorageWebTest extends BrowserTestBase {
         // @todo The ID should be an integer, but for some reason the entity field
         //   API returns a string.
    -    $this->assertTrue(is_numeric($payment->id()));
    -    $this->assertTrue(strlen($payment->uuid()));
    +    $this->assertNotEmpty(is_numeric($payment->id()));
    +    $this->assertNotEmpty(strlen($payment->uuid()));
    

    for example the first here is fine as asertTrue, but the second actually returns an integer, so we can't use assertTrue() on it.

gnanagowthaman sankar’s picture

Hi @Berdir,

Can we use assertCount here.

$this->assertNotEmpty(strlen($payment->uuid()));

Thanks & Regards,
Gnanagowthaman sankar

gnanagowthaman sankar’s picture

Status: Needs work » Needs review
StatusFileSize
new2.06 KB
new11.9 KB

Hi @Berdir,

Here by i attached some changes. Please review and let me know for changes. Can we use assertCount here.

$this->assertNotEmpty(strlen($payment->uuid()));

Please give me suggestion for this.

Thanks & Regards,
Gnanagowthaman sankar

berdir’s picture

StatusFileSize
new793 bytes

Forgot about this issue, fixed the tests already elsewhere but forgot to update the php and drupal core requirements, so doing that here.

  • Berdir committed 41daae1 on 8.x-2.x
    Issue #3103389 by Gnanagowthaman sankar, Berdir: Fix remaining...
berdir’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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