X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Ftests%2FDrupal%2FKernelTests%2FCore%2FLock%2FLockTest.php;fp=web%2Fcore%2Ftests%2FDrupal%2FKernelTests%2FCore%2FLock%2FLockTest.php;h=8e1a50d5d0ae6092695b301d9d433a5d32e46290;hp=0bd761fed23f124b623d2b39b6bf29305516378a;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/tests/Drupal/KernelTests/Core/Lock/LockTest.php b/web/core/tests/Drupal/KernelTests/Core/Lock/LockTest.php index 0bd761fed..8e1a50d5d 100644 --- a/web/core/tests/Drupal/KernelTests/Core/Lock/LockTest.php +++ b/web/core/tests/Drupal/KernelTests/Core/Lock/LockTest.php @@ -47,6 +47,21 @@ class LockTest extends KernelTestBase { $this->assertTrue($success, 'Could acquire second lock a second time within the same request.'); $this->lock->release('lock_b'); + + // Test acquiring an releasing a lock with a long key (over 255 chars). + $long_key = 'long_key:BZoMiSf9IIPULsJ98po18TxJ6T4usd3MZrLE0d3qMgG6iAgDlOi1G3oMap7zI5df84l7LtJBg4bOj6XvpO6vDRmP5h5QbA0Bj9rVFiPIPAIQZ9qFvJqTALiK1OR3GpOkWQ4vgEA4LkY0UfznrWBeuK7IWZfv1um6DLosnVXd1z1cJjvbEUqYGJj92rwHfhYihLm8IO9t3P2gAvEkH5Mhc8GBoiTsIDnP01Te1kxGFHO3RuvJIxPnHmZtSdBggmuVN7x9'; + + $success = $this->lock->acquire($long_key); + $this->assertTrue($success, 'Could acquire long key lock.'); + + // This function is not part of the backend, but the default database + // backend implement it, we can here use it safely. + $is_free = $this->lock->lockMayBeAvailable($long_key); + $this->assertFalse($is_free, 'Long key lock is unavailable.'); + + $this->lock->release($long_key); + $is_free = $this->lock->lockMayBeAvailable($long_key); + $this->assertTrue($is_free, 'Long key lock has been released.'); } /**