You are here

public function RouteBuilderTest::testRebuildBlockingLock in Drupal 8

Tests route rebuilding with a blocking lock.

File

core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php, line 118
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());
}