Piwik\Plugin\ReleaseChannels::setActiveReleaseChannelId PHP Method

setActiveReleaseChannelId() public method

Sets the given release channel in config but does not save id. $config->forceSave() still needs to be called
public setActiveReleaseChannelId ( string $channel )
$channel string
    public function setActiveReleaseChannelId($channel)
    {
        $general = Config::getInstance()->General;
        $general['release_channel'] = $channel;
        Config::getInstance()->General = $general;
    }

Usage Example

示例#1
0
 /**
  * @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);
 }