You are here

public function SemaphoreStorageTests::testPasswordStorage in Lightweight Directory Access Protocol (LDAP) 8.3

Tests the password storage.

File

ldap_user/tests/src/Unit/SemaphoreStorageTests.php, line 17

Class

SemaphoreStorageTests
@coversDefaultClass \Drupal\ldap_user\Helper\SemaphoreStorage @group ldap

Namespace

Drupal\Tests\ldap_user\Unit

Code

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'));
}