/** * @dataProvider getTestActiveReleaseChannel */ public function test_getActiveReleaseChannel_shouldReturnCorrectReleaseChannelForId($expectedId, $activeId) { $backupId = Config::getInstance()->General['release_channel']; $this->channels->setActiveReleaseChannelId($activeId); $this->assertSame($expectedId, $this->channels->getActiveReleaseChannel()->getId()); $this->channels->setActiveReleaseChannelId($backupId); }
/** * @param string $version * @param bool $https Whether to use HTTPS if supported of not. If false, will use HTTP. * @return string */ public function getArchiveUrl($version, $https = true) { $channel = $this->releaseChannels->getActiveReleaseChannel(); $url = $channel->getDownloadUrlWithoutScheme($version); if ($this->isUpdatingOverHttps() && $https) { $url = 'https' . $url; } else { $url = 'http' . $url; } return $url; }
public function __construct(ReleaseChannels $releaseChannels) { $this->releaseChannel = $releaseChannels->getActiveReleaseChannel(); }