You are here

public function ConfigEntityBaseUnitTest::testGet in Drupal 9

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

@covers ::set @covers ::get

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php, line 423
Contains \Drupal\Tests\Core\Config\Entity\ConfigEntityBaseUnitTest.

Class

ConfigEntityBaseUnitTest
@coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityBase @group Config

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testGet() {
  $name = 'id';
  $value = $this
    ->randomMachineName();
  $this
    ->assertSame($this->id, $this->entity
    ->get($name));
  $this
    ->assertSame($this->entity, $this->entity
    ->set($name, $value));
  $this
    ->assertSame($value, $this->entity
    ->get($name));
}