function ConfigEntityBaseUnitTest::testTrustDataDeprecations

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest::testTrustDataDeprecations()

Tests trusted data deprecations.

Attributes

#[IgnoreDeprecations]

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php, line 916

Class

ConfigEntityBaseUnitTest
Tests Drupal\Core\Config\Entity\ConfigEntityBase.

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testTrustDataDeprecations() : void {
  $this->expectUserDeprecationMessage('Drupal\\Core\\Config\\Entity\\ConfigEntityBase::trustData() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. There is no replacement. See https://www.drupal.org/node/3348180');
  $this->assertFalse($this->entity
    ->hasTrustedData());
  $this->entity
    ->trustData();
  $this->assertTrue($this->entity
    ->hasTrustedData());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.