You are here

public function ConfigTest::testSetName in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testSetName()
  2. 9 core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testSetName()

@covers ::setName @dataProvider setNameProvider

File

core/tests/Drupal/Tests/Core/Config/ConfigTest.php, line 73

Class

ConfigTest
Tests the Config.

Namespace

Drupal\Tests\Core\Config

Code

public function testSetName($name) {

  // Set the name.
  $this->config
    ->setName($name);

  // Check that the name has been set correctly.
  $this
    ->assertEquals($name, $this->config
    ->getName());

  // Check that the name validates.
  // Should throw \Drupal\Core\Config\ConfigNameException if invalid.
  $this->config
    ->validateName($name);
}