refreshServices example

return $hooks;
  }

  /** * Installs a module and refreshes services. * * @param string $module * The module to install. */
  protected function installModule($module) {
    $this->enableModules([$module]);
    $this->refreshServices();
  }

  /** * Uninstalls a module and refreshes services. * * @param string $module * The module to uninstall. */
  protected function uninstallModule($module) {
    $this->disableModules([$module]);
    $this->refreshServices();
  }

    $this->entity->save();
  }

  /** * Installs the Layout Builder. * * Also configures and reloads the entity display. */
  protected function installLayoutBuilder() {
    $this->container->get('module_installer')->install(['layout_builder']);
    $this->refreshServices();

    $this->display = $this->reloadEntity($this->display);
    $this->display->enableLayoutBuilder()->save();
    $this->entity = $this->reloadEntity($this->entity);
  }

  /** * Enables overrides for the display and reloads the entity. */
  protected function enableOverrides() {
    $this->display->setOverridable()->save();
    
$tests['entity_test_mulrev:id'] = ['entity_test_mulrev', 'id'];
    $tests['entity_test_mulrev:revision_id'] = ['entity_test_mulrev', 'revision_id'];
    $tests['entity_test_mulrev:langcode'] = ['entity_test_mulrev', 'langcode'];

    return $tests;
  }

  /** * {@inheritdoc} */
  protected function refreshServices() {
    parent::refreshServices();
    $this->database = $this->container->get('database');
  }

  /** * Tests that modifying the UUID field for a translatable entity works. */
  public function testModifyingTranslatableColumnSchema() {
    $this->installModule('entity_schema_test');
    $this->updateEntityType(TRUE);
    $fields = ['revision_log', 'uuid'];
    $entity_field_manager = \Drupal::service('entity_field.manager');
    
Home | Imprint | This part of the site doesn't use cookies.