function ConfigEntityStorageTest::testSaveInvalid

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest::testSaveInvalid()
  2. 8.9.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest::testSaveInvalid()
  3. 11.x core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php \Drupal\Tests\Core\Config\Entity\ConfigEntityStorageTest::testSaveInvalid()

@covers ::save

File

core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php, line 413

Class

ConfigEntityStorageTest
@coversDefaultClass \Drupal\Core\Config\Entity\ConfigEntityStorage[[api-linebreak]] @group Config

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testSaveInvalid() : void {
  $this->cacheTagsInvalidator
    ->invalidateTags(Argument::cetera())
    ->shouldNotBeCalled();
  $entity = $this->getMockEntity();
  $this->expectException(EntityMalformedException::class);
  $this->expectExceptionMessage('The entity does not have an ID.');
  $this->entityStorage
    ->save($entity);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.