You are here

public function SimpleLdapTestBase::setUp in Simple LDAP 8

Sets up common service mocks for SimpleLdap unit tests.

Parameters

string $config_name:

Overrides UnitTestCase::setUp

2 calls to SimpleLdapTestBase::setUp()
SimpleLdapServerTest::setUp in tests/src/Unit/SimpleLdapServerTest.php
Sets up common service mocks for SimpleLdap unit tests.
SimpleLdapUserManagerTest::setUp in modules/simple_ldap_user/tests/src/Unit/SimpleLdapUserManagerTest.php
Sets up common service mocks for SimpleLdap unit tests.
2 methods override SimpleLdapTestBase::setUp()
SimpleLdapServerTest::setUp in tests/src/Unit/SimpleLdapServerTest.php
Sets up common service mocks for SimpleLdap unit tests.
SimpleLdapUserManagerTest::setUp in modules/simple_ldap_user/tests/src/Unit/SimpleLdapUserManagerTest.php
Sets up common service mocks for SimpleLdap unit tests.

File

tests/src/Unit/SimpleLdapTestBase.php, line 39
Contains \Drupal\Tests\simple_ldap\Unit\SimpleLdapTestBase

Class

SimpleLdapTestBase

Namespace

Drupal\Tests\simple_ldap\Unit

Code

public function setUp() {
  parent::setUp();
  $this->config = $this
    ->getMockBuilder('\\Drupal\\Core\\Config\\ImmutableConfig')
    ->disableOriginalConstructor()
    ->getMock();
  $this->config_factory = $this
    ->getMockBuilder('\\Drupal\\Core\\Config\\ConfigFactory')
    ->disableOriginalConstructor()
    ->getMock();
  $this->config_factory
    ->expects($this
    ->once())
    ->method('get')
    ->with($this->config_name)
    ->willReturn($this->config);
}