function RouteBuilderTest::testRebuildBlockingLock

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\RouteBuilderTest::testRebuildBlockingLock()
  2. 10 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\RouteBuilderTest::testRebuildBlockingLock()
  3. 11.x core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\RouteBuilderTest::testRebuildBlockingLock()

Tests route rebuilding with a blocking lock.

File

core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php, line 121

Class

RouteBuilderTest
@coversDefaultClass \Drupal\Core\Routing\RouteBuilder @group Routing

Namespace

Drupal\Tests\Core\Routing

Code

public function testRebuildBlockingLock() {
    $this->lock
        ->expects($this->once())
        ->method('acquire')
        ->with('router_rebuild')
        ->willReturn(FALSE);
    $this->lock
        ->expects($this->once())
        ->method('wait')
        ->with('router_rebuild');
    $this->lock
        ->expects($this->never())
        ->method('release');
    $this->yamlDiscovery
        ->expects($this->never())
        ->method('findAll');
    $this->assertFalse($this->routeBuilder
        ->rebuild());
}

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