SemaphoreStorageTests.php in Lightweight Directory Access Protocol (LDAP) 8.3
File
ldap_user/tests/src/Unit/SemaphoreStorageTests.php
View source
<?php
namespace Drupal\Tests\ldap_user\Unit;
use Drupal\ldap_user\Helper\SemaphoreStorage;
use Drupal\Tests\UnitTestCase;
class SemaphoreStorageTests extends UnitTestCase {
public function testPasswordStorage() {
$this
->assertFalse(SemaphoreStorage::get('sync', 'hpotter'));
SemaphoreStorage::set('sync', 'hpotter');
SemaphoreStorage::set('sync', 'hgranger');
SemaphoreStorage::set('provision', 'hpotter');
$this
->assertTrue(SemaphoreStorage::get('sync', 'hpotter'));
SemaphoreStorage::flushValue('sync', 'hpotter');
$this
->assertFalse(SemaphoreStorage::get('sync', 'hpotter'));
$this
->assertTrue(SemaphoreStorage::get('provision', 'hpotter'));
SemaphoreStorage::set('sync', 'hpotter');
SemaphoreStorage::flushAllValues();
$this
->assertFalse(SemaphoreStorage::get('sync', 'hpotter'));
$this
->assertFalse(SemaphoreStorage::get('sync', 'hgranger'));
}
}