You are here

public function EncryptedFieldValueManagerTest::testDeleteEncryptedFieldValuesForField in Field Encryption 8.2

Test the deleteEncryptedFieldValuesForField method.

@covers ::__construct @covers ::deleteEncryptedFieldValuesForField

File

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

Class

EncryptedFieldValueManagerTest
Unit Tests for the EncryptedFieldValueManager service.

Namespace

Drupal\Tests\field_encrypt\Unit

Code

public function testDeleteEncryptedFieldValuesForField() {

  // 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
    ->deleteEncryptedFieldValuesForField('node', 'field_test');
}