You are here

protected function SyncMappingHelperTests::setUp in Lightweight Directory Access Protocol (LDAP) 8.3

Prepare the sync mapping tests.

Overrides UnitTestCase::setUp

File

ldap_user/tests/src/Unit/SyncMappingHelperTests.php, line 24

Class

SyncMappingHelperTests
@coversDefaultClass \Drupal\ldap_user\Helper\SyncMappingHelper @group ldap

Namespace

Drupal\Tests\ldap_user\Unit

Code

protected function setUp() {
  parent::setUp();

  /* Mocks the configuration due to detailed watchdog logging. */
  $this->config = $this
    ->getMockBuilder('\\Drupal\\Core\\Config\\ImmutableConfig')
    ->disableOriginalConstructor()
    ->getMock();
  $this->configFactory = $this
    ->getMockBuilder('\\Drupal\\Core\\Config\\ConfigFactory')
    ->disableOriginalConstructor()
    ->getMock();
  $this->configFactory
    ->expects($this
    ->any())
    ->method('get')
    ->with('ldap_user.settings')
    ->willReturn($this->config);
  $this->container = new ContainerBuilder();
  $this->container
    ->set('config.factory', $this->configFactory);
  \Drupal::setContainer($this->container);
}