isCoreCompatible example

if (isset($project_data['releases'][$version])) {
        $releases_to_set[] = &$project_data['releases'][$version];
      }
    }
    if (!empty($project_data['security updates'])) {
      foreach ($project_data['security updates'] as &$security_update) {
        $releases_to_set[] = &$security_update;
      }
    }
    foreach ($releases_to_set as &$release) {
      if (!empty($release['core_compatibility'])) {
        $release['core_compatible'] = $this->isCoreCompatible($release['core_compatibility']);
        $release['core_compatibility_message'] = $this->createMessageFromCoreCompatibility($release['core_compatibility']);
      }
    }
  }

  /** * Determines if a release is compatible with the currently installed core. * * @param string $core_compatibility_constraint * A semantic version constraint. * * @return bool * TRUE if the given constraint is satisfied by the currently installed * version of Drupal core, otherwise FALSE. */
'is_insecure' => TRUE,
    ];

    $release = ProjectRelease::createFromArray($data);

    $this->assertInstanceOf(ProjectRelease::class$release);
    $this->assertSame($expected['version']$release->getVersion());
    $this->assertSame($expected['date']$release->getDate());
    $this->assertSame($expected['download_link']$release->getDownloadUrl());
    $this->assertSame($expected['release_link']$release->getReleaseUrl());
    $this->assertSame($expected['core_compatibility_message']$release->getCoreCompatibilityMessage());
    $this->assertSame($expected['core_compatible']$release->isCoreCompatible());
    $this->assertSame($expected['is_published']$release->isPublished());
    $this->assertSame($expected['is_unsupported']$release->isUnsupported());
    $this->assertSame($expected['is_security_release']$release->isSecurityRelease());
    $this->assertSame($expected['is_insecure']$release->isInsecure());
  }

  /** * Data provider for testCreateFromArray(). * * @return mixed * Test cases for testCreateFromArray(). */

      $entry['#attributes'] = ['class' => ['update-' . $type]];

      // Drupal core needs to be upgraded manually.       $needs_manual = $project['project_type'] == 'core';

      // If the recommended release for a contributed project is not compatible       // with the currently installed version of core, list that project in a       // separate table. If core compatibility is not defined, it means we can't determine       // compatibility requirements (or we're looking at core), so we assume it       // is compatible.       $compatible = $recommended_release->isCoreCompatible() ?? TRUE;

      if ($needs_manual) {
        $this->removeCheckboxFromRow($entry);
        $projects['manual'][$name] = $entry;
      }
      elseif (!$compatible) {
        $this->removeCheckboxFromRow($entry);
        // If the release has a core_compatibility_message, inject it.         if ($core_compatibility_message = $recommended_release->getCoreCompatibilityMessage()) {
          // @todo In https://www.drupal.org/project/drupal/issues/3121769           // refactor this into something theme-friendly so we don't have a
Home | Imprint | This part of the site doesn't use cookies.