Problem/Motivation

When running tests in Drupal 9.2.0 there are a number of deprecation warnings:

  10x: Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked. See https://www.drupal.org/node/3201242
    5x in MetricsEndpointTest::testMetrics from Drupal\Tests\prometheus_exporter\Kernel
    5x in MetricsEndpointTest::testDisabledMetrics from Drupal\Tests\prometheus_exporter\Kernel

  3x: Installing the tables key_value and key_value_expire with the method KernelTestBase::installSchema() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. The tables are now lazy loaded and therefore will be installed automatically when used. See https://www.drupal.org/node/3143286
    1x in PrometheusExporterSettingsTest::testSettingsForm from Drupal\Tests\prometheus_exporter\Kernel\Form
    1x in MetricsEndpointTest::testMetrics from Drupal\Tests\prometheus_exporter\Kernel
    1x in MetricsEndpointTest::testDisabledMetrics from Drupal\Tests\prometheus_exporter\Kernel

Steps to reproduce

Run tests against Drupal 9.2.0

Proposed resolution

Fix deprecations

Remaining tasks

Review patch

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Comments

mstrelan created an issue. See original summary.

kim.pepper’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x-1.x. Thanks!

mstrelan’s picture

Status: Fixed » Needs review
StatusFileSize
new3.54 KB

Sorry I think adding that trait broke PHPUnit 8 compatibility. This should be the correct approach (extending UnitTestCase).

mstrelan’s picture

StatusFileSize
new5.53 KB
new1.56 KB

Removed a couple more instances of ProphecyTrait

mstrelan’s picture

Try again ...

  • kim.pepper committed f50db04 on 8.x-1.x authored by mstrelan
    Issue #3220005 by mstrelan, kim.pepper: Fix deprecations (8.9.x compat)
    
kim.pepper’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x-1.x. Thanks again!

Status: Fixed » Closed (fixed)

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