Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
I've started running kernel tests against modules and got these deprecation warnings in the profile module:
OK (9 tests, 149 assertions)
Remaining self deprecation notices (5)
4x: Calling createUser() with $permissions as the second parameter is deprecated in drupal:10.1.0 and will be removed from drupal:11.0.0. Use createUser(array $permissions = [], $name = NULL, $admin = FALSE, array $values = []) instead. See https://www.drupal.org/node/3330762
3x in ProfileRoleAccessTest::testProfileOperations from Drupal\Tests\profile\Kernel
1x in ProfileRoleAccessTest::testProfileCreate from Drupal\Tests\profile\Kernel
1x: The Drupal\Tests\field\Traits\EntityReferenceTestTrait is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Instead, use \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait. See https://www.drupal.org/node/3401941
1x in KernelTestSuite::suite from Drupal\Tests\TestSuites
Steps to reproduce
Run the tests in profile. The way I am doing it is with:
phpunit testsuite="kernel" --group="profile"
Proposed resolution
Follow the suggestions to replace the function and class.
Comments
Comment #3
jsacksick CreditAttribution: jsacksick at Centarro commentedThanks for the report, fixed.