public function ConfigEntityStorageTest::testHasData in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php \Drupal\KernelTests\Core\Config\ConfigEntityStorageTest::testHasData()
- 9 core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStorageTest.php \Drupal\KernelTests\Core\Config\ConfigEntityStorageTest::testHasData()
Tests the hasData() method for config entity storage.
@covers \Drupal\Core\Config\Entity\ConfigEntityStorage::hasData
File
- core/tests/ Drupal/ KernelTests/ Core/ Config/ ConfigEntityStorageTest.php, line 59 
Class
- ConfigEntityStorageTest
- Tests sync and importing config entities with IDs and UUIDs that match existing config.
Namespace
Drupal\KernelTests\Core\ConfigCode
public function testHasData() {
  $storage = \Drupal::entityTypeManager()
    ->getStorage('config_test');
  $this
    ->assertFalse($storage
    ->hasData());
  // Add a test config entity and check again.
  $storage
    ->create([
    'id' => $this
      ->randomMachineName(),
  ])
    ->save();
  $this
    ->assertTrue($storage
    ->hasData());
}