function LockBackendAbstractTest::testWaitTrue

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php \Drupal\Tests\Core\Lock\LockBackendAbstractTest::testWaitTrue()
  2. 9 core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php \Drupal\Tests\Core\Lock\LockBackendAbstractTest::testWaitTrue()
  3. 8.9.x core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php \Drupal\Tests\Core\Lock\LockBackendAbstractTest::testWaitTrue()

Tests the wait() method when lockMayBeAvailable() returns FALSE.

Waiting could take 1 second so we need to extend the possible runtime.

File

core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php, line 55

Class

LockBackendAbstractTest
Tests Drupal\Core\Lock\LockBackendAbstract.

Namespace

Drupal\Tests\Core\Lock

Code

public function testWaitTrue() : void {
  $this->lock
    ->expects($this->any())
    ->method('lockMayBeAvailable')
    ->with($this->equalTo('test_name'))
    ->willReturn(FALSE);
  $this->assertTrue($this->lock
    ->wait('test_name', 1));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.