public function LockBackendAbstractTest::testGetLockId in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php \Drupal\Tests\Core\Lock\LockBackendAbstractTest::testGetLockId()
Test the getLockId() method.
File
- core/
tests/ Drupal/ Tests/ Core/ Lock/ LockBackendAbstractTest.php, line 59 - Contains \Drupal\Tests\Core\Lock\LockBackendAbstractTest.
Class
- LockBackendAbstractTest
- @coversDefaultClass \Drupal\Tests\Core\Lock\LockBackendAbstractTest @group Lock
Namespace
Drupal\Tests\Core\LockCode
public function testGetLockId() {
$lock_id = $this->lock
->getLockId();
$this
->assertInternalType('string', $lock_id);
// Example lock ID would be '7213141505232b6ee2cb967.27683891'.
$this
->assertRegExp('/[\\da-f]+\\.\\d+/', $lock_id);
// Test the same lock ID is returned a second time.
$this
->assertSame($lock_id, $this->lock
->getLockId());
}