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
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff-5-6.txt | 695 bytes | mstrelan |
| #6 | prometheus_exporter-deprecations-3220005-6.patch | 6.33 KB | mstrelan |
| #5 | interdiff-4-5.txt | 1.56 KB | mstrelan |
| #5 | prometheus_exporter-deprecations-3220005-5.patch | 5.53 KB | mstrelan |
| prometheus_exporter-fix-deprecations.patch | 10.01 KB | mstrelan |
Comments
Comment #3
kim.pepperCommitted and pushed to 8.x-1.x. Thanks!
Comment #4
mstrelan commentedSorry I think adding that trait broke PHPUnit 8 compatibility. This should be the correct approach (extending UnitTestCase).
Comment #5
mstrelan commentedRemoved a couple more instances of ProphecyTrait
Comment #6
mstrelan commentedTry again ...
Comment #8
kim.pepperCommitted and pushed to 8.x-1.x. Thanks again!