You are here

public function RouteBuilderTest::testRebuildBlockingLock in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 117
Contains \Drupal\Tests\Core\Routing\RouteBuilderTest.

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')
    ->will($this
    ->returnValue(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());
}