IntegrationTest.php in Lightweight Directory Access Protocol (LDAP) 8.4
File
ldap_user/tests/src/Kernel/IntegrationTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\ldap_user\Kernel;
use Drupal\KernelTests\KernelTestBase;
use Drupal\user\Entity\User;
class IntegrationTest extends KernelTestBase {
protected static $modules = [
'authorization',
'externalauth',
'ldap_servers',
'ldap_user',
'ldap_query',
'user',
];
protected $configFactory;
public function setUp() : void {
parent::setUp();
$this
->installConfig([
'ldap_user',
]);
$this->configFactory = $this->container
->get('config.factory');
}
public function testConfig() : void {
$value = $this->configFactory
->get('ldap_user.settings')
->get('orphanedAccountCheckInterval');
self::assertEquals('weekly', $value);
}
public function brokenTestProcessor() : void {
$processor = \Drupal::service('ldap.drupal_user_processor');
$processor
->createDrupalUserFromLdapEntry([
'name' => 'hpotter',
]);
$user = $processor
->getUserAccount();
self::assertInstanceOf(User::class, $user);
}
}