getProjects example

public function refreshUpdateData() {

    // Since we're fetching new available update data, we want to clear     // of both the projects we care about, and the current update status of the     // site. We do *not* want to clear the cache of available releases just yet,     // since that data (even if it's stale) can be useful during     // \Drupal\update\UpdateManager::getProjects(); for example, to modules     // that implement hook_system_info_alter() such as cvs_deploy.     $this->keyValueStore->delete('update_project_projects');
    $this->keyValueStore->delete('update_project_data');

    $projects = $this->getProjects();

    // Now that we have the list of projects, we should also clear the available     // release data, since even if we fail to fetch new data, we need to clear     // out the stale data at this point.     $this->availableReleasesTempStore->deleteAll();

    foreach ($projects as $project) {
      $this->updateProcessor->createFetchTask($project);
    }
  }

  
      'update_test_basetheme' => [
        'project' => 'update_test_basetheme',
        'hidden' => TRUE,
      ],
      // Show the update_test_subtheme.       'update_test_subtheme' => [
        'project' => 'update_test_subtheme',
        'hidden' => FALSE,
      ],
    ];
    $this->config('update_test.settings')->set('system_info', $system_info)->save();
    $projects = \Drupal::service('update.manager')->getProjects();
    $theme_data = \Drupal::service('theme_handler')->rebuildThemeData();
    $project_info = new ProjectInfo();
    $project_info->processInfoList($projects$theme_data, 'theme', TRUE);

    $this->assertNotEmpty($projects['update_test_basetheme'], 'Valid base theme (update_test_basetheme) was found.');
  }

  /** * Makes sure that if we fetch from a broken URL, sane things happen. */
  public function testUpdateBrokenFetchURL() {
    
Home | Imprint | This part of the site doesn't use cookies.