예제 #1
0
 /**
  * @dataProvider channelProvider
  *
  * @param string $channel
  */
 public function testOverrideChannel($channel)
 {
     \OCP\Util::setChannel($channel);
     $actual = \OCP\Util::getChannel($channel);
     $this->assertEquals($channel, $actual);
 }
예제 #2
0
 /**
  * @UseSession
  *
  * @param string $channel
  * @return DataResponse
  */
 public function setChannel($channel)
 {
     \OCP\Util::setChannel($channel);
     $this->config->setAppValue('core', 'lastupdatedat', 0);
     return new DataResponse(['status' => 'success', 'data' => ['message' => $this->l10n->t('Updated channel')]]);
 }
예제 #3
0
 /**
  * Set a new value
  * @return string
  */
 public function setCurrentChannel($newChannel)
 {
     $cleanValue = preg_replace('/[^A-Za-z0-9]/', '', $newChannel);
     \OCP\Util::setChannel($cleanValue);
     return $cleanValue;
 }