You are here

public function EncryptedFieldValueManagerTest::testDeleteEntityEncryptedFieldValues in Field Encryption 8.2

Test the deleteEntityEncryptedFieldValues method.

@covers ::__construct @covers ::deleteEntityEncryptedFieldValues

File

tests/src/Unit/EncryptedFieldValueManagerTest.php, line 244
Contains \Drupal\Tests\field_encrypt\Unit\EncryptedFieldValueManagerTest.

Class

EncryptedFieldValueManagerTest
Unit Tests for the EncryptedFieldValueManager service.

Namespace

Drupal\Tests\field_encrypt\Unit

Code

public function testDeleteEntityEncryptedFieldValues() {

  // Set up expectations for storage.
  $this->storage
    ->expects($this
    ->once())
    ->method('loadByProperties')
    ->will($this
    ->returnValue([
    $this->encryptedFieldValue,
  ]));
  $this->storage
    ->expects($this
    ->once())
    ->method('delete');
  $service = new EncryptedFieldValueManager($this->entityManager);
  $service
    ->deleteEntityEncryptedFieldValues($this->entity);
}