You are here

public function ConfigTest::testInitWithData 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::testInitWithData()
  2. 9 core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testInitWithData()

@covers ::initWithData @dataProvider nestedDataProvider

File

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

Class

ConfigTest
Tests the Config.

Namespace

Drupal\Tests\Core\Config

Code

public function testInitWithData($data) {
  $config = $this->config
    ->initWithData($data);

  // Should return the Config object.
  $this
    ->assertInstanceOf('\\Drupal\\Core\\Config\\Config', $config);

  // Check config is not new.
  $this
    ->assertEquals(FALSE, $this->config
    ->isNew());

  // Check that data value was set correctly.
  $this
    ->assertConfigDataEquals($data);

  // Check that original data was set.
  $this
    ->assertOriginalConfigDataEquals($data, TRUE);

  // Check without applying overrides.
  $this
    ->assertOriginalConfigDataEquals($data, FALSE);
}