getDownloadUrl example

// @todo In https://www.drupal.org/project/drupal/issues/3121769           // refactor this into something theme-friendly so we don't have a           // classless <div> here.           $entry['data']['recommended_version']['data']['#template'] .= ' <div>{{ core_compatibility_message }}</div>';
          $entry['data']['recommended_version']['data']['#context']['core_compatibility_message'] = $core_compatibility_message;
        }
        $projects['not-compatible'][$name] = $entry;
      }
      else {
        $form['project_downloads'][$name] = [
          '#type' => 'value',
          '#value' => $recommended_release->getDownloadUrl(),
        ];

        // Based on what kind of project this is, save the entry into the         // appropriate subarray.         switch ($project['project_type']) {
          case 'module':
          case 'theme':
            $projects['enabled'][$name] = $entry;
            break;

          case 'module-disabled':
          
'is_published' => TRUE,
      '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.