StdClass example


  public function providerPrivateImageStyleDownloadPolicy() {
    return [
      [ResponsePolicyInterface::DENY, 'entity.node.preview'],
      [NULL, 'some.other.route'],
      [NULL, NULL],
      [NULL, FALSE],
      [NULL, TRUE],
      [NULL, new \StdClass()],
      [NULL, [1, 2, 3]],
    ];
  }

}

  protected function setUpEntityType(EntityTypeInterface $definition, array $base_fields = []) {
    // Replace the cache backend in the entity type manager so it returns     // our test entity type in addition to the existing ones.     $definitions = $this->entityTypeManager->getDefinitions();
    $definitions[$definition->id()] = $definition;

    $cache_backend = $this->prophesize(CacheBackendInterface::class);
    $cache_data = new \StdClass();
    $cache_data->data = $definitions;
    $cache_backend->get('entity_type')->willReturn($cache_data);
    $this->entityTypeManager->setCacheBackend($cache_backend->reveal(), 'entity_type', ['entity_types']);
    $this->entityTypeManager->clearCachedDefinitions();

    if ($base_fields) {
      ViewsTestEntity::setMockedBaseFieldDefinitions($definition->id()$base_fields);
    }
  }

  /** * Tests base tables. */

  public function providerPrivateImageStyleDownloadPolicy() {
    return [
      [ResponsePolicyInterface::DENY, 'image.style_private'],
      [NULL, 'some.other.route'],
      [NULL, NULL],
      [NULL, FALSE],
      [NULL, TRUE],
      [NULL, new \StdClass()],
      [NULL, [1, 2, 3]],
    ];
  }

}
Home | Imprint | This part of the site doesn't use cookies.