You are here

public function RestClientTest::setUp in Salesforce Suite 8.3

Same name in this branch
  1. 8.3 tests/src/Unit/RestClientTest.php \Drupal\Tests\salesforce\Unit\RestClientTest::setUp()
  2. 8.3 modules/salesforce_encrypt/tests/src/Unit/RestClientTest.php \Drupal\Tests\salesforce_encrypt\Unit\RestClientTest::setUp()

Overrides UnitTestCase::setUp

File

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

Class

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

Namespace

Drupal\Tests\salesforce_encrypt\Unit

Code

public function setUp() {
  parent::setUp();
  $this->accessToken = 'foo';
  $this->refreshToken = 'bar';
  $this->identity = [
    'zee' => 'bang',
  ];
  $this->httpClient = $this
    ->getMock(Client::CLASS);
  $this->configFactory = $this
    ->getMockBuilder(ConfigFactory::CLASS)
    ->disableOriginalConstructor()
    ->getMock();
  $this->state = $this
    ->getMockBuilder(State::CLASS)
    ->disableOriginalConstructor()
    ->getMock();
  $this->cache = $this
    ->createMock(CacheBackendInterface::CLASS);
  $this->json = $this
    ->createMock('Drupal\\Component\\Serialization\\Json');
  $this->encryption = $this
    ->createMock(EncryptServiceInterface::CLASS);
  $this->profileManager = $this
    ->createMock(EncryptionProfileManagerInterface::CLASS);
  $this->lock = $this
    ->createMock(LockBackendInterface::CLASS);
  $this->encryptionProfile = $this
    ->createMock(EncryptionProfileInterface::CLASS);
  $this->json = $this
    ->createMock(Json::CLASS);
  $this->time = $this
    ->createMock(TimeInterface::CLASS);
  $this->client = $this
    ->getMockBuilder(RestClient::CLASS)
    ->setMethods([
    'doGetEncryptionProfile',
  ])
    ->setConstructorArgs([
    $this->httpClient,
    $this->configFactory,
    $this->state,
    $this->cache,
    $this->json,
    $this->time,
    $this->encryption,
    $this->profileManager,
    $this->lock,
  ])
    ->getMock();
}