NodeAccessControlHandler example

->willReturn($node);
    $entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
    $entityTypeManager->expects($this->any())
      ->method('getStorage')
      ->with('node')
      ->willReturn($nodeStorage);

    $moduleHandler = $this->createMock(ModuleHandlerInterface::class);
    $moduleHandler->expects($this->any())
      ->method('invokeAll')
      ->willReturn([]);
    $accessControl = new NodeAccessControlHandler($entityType$grants$entityTypeManager);
    $accessControl->setModuleHandler($moduleHandler);

    $access = $accessControl->access($node$operation$account, FALSE);
    $this->assertEquals($assertAccess$access);
  }

  /** * Data provider for revisionOperationsProvider. * * @return array * Data for testing. */
Home | Imprint | This part of the site doesn't use cookies.