public function ConfigTest::testSaveNew in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Config/ConfigTest.php \Drupal\Tests\Core\Config\ConfigTest::testSaveNew()
@covers ::save @dataProvider nestedDataProvider
File
- core/
tests/ Drupal/ Tests/ Core/ Config/ ConfigTest.php, line 129
Class
- ConfigTest
- Tests the Config.
Namespace
Drupal\Tests\Core\ConfigCode
public function testSaveNew($data) {
$this->cacheTagsInvalidator
->expects($this
->never())
->method('invalidateTags');
// Set initial data.
$this->config
->setData($data);
// Check that original data has not been set yet.
foreach ($data as $key => $value) {
$this
->assertNull($this->config
->getOriginal($key, FALSE));
}
// Save so that the original data is set.
$config = $this->config
->save();
// Check that returned $config is instance of Config.
$this
->assertInstanceOf('\\Drupal\\Core\\Config\\Config', $config);
// Check that the original data it saved.
$this
->assertOriginalConfigDataEquals($data, TRUE);
}