getReleaseUrl example

$recommended_version = '{{ release_version }} (<a href="{{ release_link }}" title="{{ project_title }}">{{ release_notes }}</a>)';
      $recommended_version_parser = ExtensionVersion::createFromVersionString($recommended_release->getVersion());
      if ($recommended_version_parser->getMajorVersion() != $project['existing_major']) {
        $recommended_version .= '<div title="{{ major_update_warning_title }}" class="update-major-version-warning">{{ major_update_warning_text }}</div>';
      }

      $recommended_version = [
        '#type' => 'inline_template',
        '#template' => $recommended_version,
        '#context' => [
          'release_version' => $recommended_release->getVersion(),
          'release_link' => $recommended_release->getReleaseUrl(),
          'project_title' => $this->t('Release notes for @project_title', ['@project_title' => $project['title']]),
          'major_update_warning_title' => $this->t('Major upgrade warning'),
          'major_update_warning_text' => $this->t('This update is a major version update which means that it may not be backwards compatible with your currently running version. It is recommended that you read the release notes and proceed at your own risk.'),
          'release_notes' => $this->t('Release notes'),
        ],
      ];

      // Create an entry for this project.       $entry = [
        'title' => $project_name,
        'installed_version' => $project['existing_version'],
        
'is_unsupported' => TRUE,
      'is_security_release' => TRUE,
      '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(). */
Home | Imprint | This part of the site doesn't use cookies.