@trigger_error("Getting the password property is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. See https://www.drupal.org/node/3569185",E_USER_DEPRECATED);
@@ -108,4 +109,20 @@ public function testChainExistingPasswordMethod(): void {
$this->assertInstanceOf(User::class,$user);
}
/**
* Tests that accessing the password property is correctly deprecated.
*/
#[IgnoreDeprecations]
publicfunctiontestPasswordProperty():void{
/** @var \Drupal\user\Entity\User $user */
$user=User::create([
'name'=>$this->randomMachineName(),
]);
$user->password='password';
$this->expectDeprecation('Getting the password property is deprecated in drupal:11.4.0 and is removed from drupal:12.0.0. See https://www.drupal.org/node/3569185');