registerInvokedUpdates example

->shouldBeCalledTimes(1);
    $key_value->set('existing_updates', ['module_a_post_update_a'])
      ->willReturn(NULL)
      ->shouldBeCalledTimes(1);
    $key_value = $key_value->reveal();

    $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
      'module_a',
      'module_b',
      'theme_d',
    ]$key_value, FALSE);
    $update_registry->registerInvokedUpdates(['module_a_post_update_a']);
  }

  /** * @covers ::registerInvokedUpdates */
  public function testRegisterInvokedUpdatesWithMultiple() {
    $this->setupBasicExtensions();
    $key_value = $this->prophesize(KeyValueStoreInterface::class);
    $key_value->get('existing_updates', [])
      ->willReturn([])
      ->shouldBeCalledTimes(1);
    
      // discovery works as expected.       $this->enabledExtensions = $new_extension_list;

      foreach ($uninstalled_extensions as $uninstalled_extension) {
        $this->filterOutInvokedUpdatesByExtension($uninstalled_extension);
      }
      foreach ($installed_extensions as $installed_extension) {
        // Ensure that all post_update functions are registered already. This         // should include existing post-updates, as well as any specified as         // having been previously removed, to ensure that newly installed and         // updated sites have the same entries in the registry.         $this->registerInvokedUpdates(array_merge(
          $this->getUpdateFunctions($installed_extension),
          array_keys($this->getRemovedPostUpdates($installed_extension))
        ));
      }
    }
  }

  /** * {@inheritdoc} */
  public static function getSubscribedEvents() {
    
Home | Imprint | This part of the site doesn't use cookies.