class DrupalUserProcessorTests in Lightweight Directory Access Protocol (LDAP) 8.3
Tests for the DrupalUserProcessor.
@coversDefaultClass \Drupal\ldap_user\Processor\DrupalUserProcessor @group ldap
Hierarchy
- class \Drupal\Tests\UnitTestCase extends \PHPUnit\Framework\TestCase uses PhpunitCompatibilityTrait
- class \Drupal\Tests\ldap_user\Unit\DrupalUserProcessorTests implements LdapUserAttributesInterface
Expanded class hierarchy of DrupalUserProcessorTests
File
- ldap_user/
tests/ src/ Unit/ DrupalUserProcessorTests.php, line 15
Namespace
Drupal\Tests\ldap_user\UnitView source
class DrupalUserProcessorTests extends UnitTestCase implements LdapUserAttributesInterface {
public $cacheFactory;
public $configFactory;
public $serverFactory;
public $config;
public $container;
public $provisioningEvents;
/**
* Test setup.
*/
protected function setUp() {
parent::setUp();
$this->provisioningEvents = [
self::PROVISION_TO_DRUPAL => [
self::EVENT_SYNC_TO_DRUPAL_USER,
self::EVENT_SYNC_TO_DRUPAL_USER,
],
self::PROVISION_TO_LDAP => [
self::EVENT_SYNC_TO_LDAP_ENTRY,
self::EVENT_CREATE_LDAP_ENTRY,
],
];
$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->cacheFactory = $this
->getMockBuilder('\\Drupal\\Core\\Cache\\CacheFactory')
->disableOriginalConstructor()
->getMock();
$this->cacheFactory
->expects($this
->any())
->method('get')
->willReturn(FALSE);
$this->detailLog = $this
->getMockBuilder('\\Drupal\\ldap_servers\\Logger\\LdapDetailLog')
->disableOriginalConstructor()
->getMock();
$this->container = new ContainerBuilder();
$this->container
->set('config.factory', $this->configFactory);
$this->container
->set('cache.default', $this->cacheFactory);
$this->container
->set('ldap.detail_log', $this->detailLog);
\Drupal::setContainer($this->container);
}
/**
* Placeholder test.
*/
public function testBase() {
$this
->assertTrue(TRUE);
}
}