You are here

public function RestClientTest::testEncryptNotNull in Salesforce Suite 8.3

@covers ::encrypt

This test covers the case where access token is not NULL.

File

modules/salesforce_encrypt/tests/src/Unit/RestClientTest.php, line 105

Class

RestClientTest
@coversDefaultClass \Drupal\salesforce_encrypt\Rest\RestClient @group salesforce

Namespace

Drupal\Tests\salesforce_encrypt\Unit

Code

public function testEncryptNotNull() {

  // Test unencrypted.
  $this->state
    ->expects($this
    ->any())
    ->method('get')
    ->willReturn('not null');
  $this->client
    ->expects($this
    ->any())
    ->method('doGetEncryptionProfile')
    ->willReturn($this->encryptionProfile);
  $this->encryption
    ->expects($this
    ->any())
    ->method('decrypt')
    ->willReturn($this->accessToken);
  $this
    ->assertEquals($this->accessToken, $this->client
    ->getAccessToken());
}