You are here

public function RouteSubscriberTest::testDisabledReplicateFunctionality in Replicate UI 8

@covers ::onRouteBuild

File

tests/src/Unit/RouteSubscriberTest.php, line 22

Class

RouteSubscriberTest
@coversDefaultClass \Drupal\replicate_ui\RouteSubscriber @group replicate

Namespace

Drupal\Tests\replicate_ui\Unit

Code

public function testDisabledReplicateFunctionality() {
  $em = $this
    ->setupEntityManager();
  $config_manager = $this
    ->getConfigFactoryStub([
    'replicate_ui.settings' => [
      'entity_types' => [],
    ],
  ]);
  $subscriber = new RouteSubscriber($em
    ->reveal(), $config_manager);
  $routes = $this
    ->setupRouteCollection();
  $event = new RouteBuildEvent($routes);
  $this
    ->assertCount(4, $routes);
  $subscriber
    ->onRouteBuild($event);
  $this
    ->assertCount(4, $routes);
}