setUpModuleHandlerNoImplementations example

$this->entityStorage = new SqlContentEntityStorage($this->entityType, $this->connection, $this->entityFieldManager->reveal()$this->cache, $this->languageManager, new MemoryCache()$this->entityTypeBundleInfo, $this->entityTypeManager->reveal());
    $this->entityStorage->setModuleHandler($this->moduleHandler);
  }

  /** * @covers ::doLoadMultiple * @covers ::buildCacheId * @covers ::getFromPersistentCache */
  public function testLoadMultiplePersistentCached() {
    $this->setUpModuleHandlerNoImplementations();

    $key = 'values:' . $this->entityTypeId . ':1';
    $id = 1;
    $entity = $this->getMockBuilder('\Drupal\Tests\Core\Entity\Sql\SqlContentEntityStorageTestEntityInterface')
      ->getMockForAbstractClass();
    $entity->expects($this->any())
      ->method('id')
      ->willReturn($id);

    $this->entityType->expects($this->atLeastOnce())
      ->method('isPersistentlyCacheable')
      
Home | Imprint | This part of the site doesn't use cookies.