function UpdateFetcherTest::testUpdateBuildFetchUrl

Same name in other branches
  1. 9 core/modules/update/tests/src/Unit/UpdateFetcherTest.php \Drupal\Tests\update\Unit\UpdateFetcherTest::testUpdateBuildFetchUrl()
  2. 10 core/modules/update/tests/src/Unit/UpdateFetcherTest.php \Drupal\Tests\update\Unit\UpdateFetcherTest::testUpdateBuildFetchUrl()
  3. 11.x core/modules/update/tests/src/Unit/UpdateFetcherTest.php \Drupal\Tests\update\Unit\UpdateFetcherTest::testUpdateBuildFetchUrl()

Tests that buildFetchUrl() builds the URL correctly.

@dataProvider providerTestUpdateBuildFetchUrl

Parameters

array $project: A keyed array of project information matching results from \Drupal\update\UpdateManager::getProjects().

string $site_key: A string to mimic an anonymous site key hash.

string $expected: The expected url returned from UpdateFetcher::buildFetchUrl()

See also

\Drupal\update\UpdateFetcher::buildFetchUrl()

File

core/modules/update/tests/src/Unit/UpdateFetcherTest.php, line 46

Class

UpdateFetcherTest
Tests update functionality unrelated to the database.

Namespace

Drupal\Tests\update\Unit

Code

public function testUpdateBuildFetchUrl(array $project, $site_key, $expected) {
    $url = $this->updateFetcher
        ->buildFetchUrl($project, $site_key);
    $this->assertEquals($url, $expected);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.