Commit 8d114d91 authored by Project Update Bot's avatar Project Update Bot Committed by Rick Hawkins
Browse files

Issue #3297063 by jcnventura, Project Update Bot: Automated Drupal 10 compatibility fixes

parent caaa5135
Loading
Loading
Loading
Loading
+34 −5
Original line number Diff line number Diff line
@@ -84,7 +84,10 @@ class EncryptionProfileTest extends UnitTestCase {
    $this->keyRepository = $this->createMock('\Drupal\key\KeyRepository');

    // Mock a plugin collection.
    $this->pluginCollection = $this->createMock('\Drupal\Core\Plugin\DefaultLazyPluginCollection');
    $this->pluginCollection = $this->getMockBuilder('\Drupal\Core\Plugin\DefaultLazyPluginCollection')
      ->disableOriginalConstructor()
      ->setMethods(['get', 'set', 'addInstanceID'])
      ->getMock();
  }

  /**
@@ -97,7 +100,16 @@ class EncryptionProfileTest extends UnitTestCase {
   */
  public function testValidate($enc_method_id, $enc_key, $enc_method_def, $expected_errors) {
    // Set up a mock for the EncryptionProfile class to mock some methods.
    $encryption_profile = $this->createMock('\Drupal\encrypt\Entity\EncryptionProfile');
    $encryption_profile = $this->getMockBuilder('\Drupal\encrypt\Entity\EncryptionProfile')
      ->setMethods([
        'getEncryptionMethod',
        'getEncryptionMethodId',
        'getEncryptionKey',
        'getEncryptionKeyId',
      ]
      )
      ->disableOriginalConstructor()
      ->getMock();

    // Set expectations for the EncryptionMethod.
    $this->encryptionMethod->expects($this->any())
@@ -190,7 +202,14 @@ class EncryptionProfileTest extends UnitTestCase {
   */
  public function testGetEncryptionMethod() {
    // Set up a mock for the EncryptionProfile class to mock some methods.
    $encryption_profile = $this->createMock('\Drupal\encrypt\Entity\EncryptionProfile');
    $encryption_profile = $this->getMockBuilder('\Drupal\encrypt\Entity\EncryptionProfile')
      ->setMethods([
        'getPluginCollection',
        'getEncryptionMethodId',
      ]
      )
      ->disableOriginalConstructor()
      ->getMock();

    // Set up expectations for plugin collection.
    $this->pluginCollection->expects($this->atLeastOnce())
@@ -217,7 +236,10 @@ class EncryptionProfileTest extends UnitTestCase {
   */
  public function testSetEncryptionMethod() {
    // Set up a mock for the EncryptionProfile class to mock some methods.
    $encryption_profile = $this->createMock('\Drupal\encrypt\Entity\EncryptionProfile');
    $encryption_profile = $this->getMockBuilder('\Drupal\encrypt\Entity\EncryptionProfile')
      ->setMethods(['getPluginCollection'])
      ->disableOriginalConstructor()
      ->getMock();

    $this->pluginCollection->expects($this->once())
      ->method('addInstanceID');
@@ -242,7 +264,14 @@ class EncryptionProfileTest extends UnitTestCase {
   */
  public function testGetEncryptionKey() {
    // Set up a mock for the EncryptionProfile class to mock some methods.
    $encryption_profile = $this->createMock('\Drupal\encrypt\Entity\EncryptionProfile');
    $encryption_profile = $this->getMockBuilder('\Drupal\encrypt\Entity\EncryptionProfile')
      ->setMethods([
        'getKeyRepository',
        'getEncryptionKeyId',
      ]
      )
      ->disableOriginalConstructor()
      ->getMock();

    $this->keyRepository->expects($this->any())
      ->method('getKey')