/** * @dataProvider channelProvider * * @param string $channel */ public function testOverrideChannel($channel) { \OCP\Util::setChannel($channel); $actual = \OCP\Util::getChannel($channel); $this->assertEquals($channel, $actual); }
/** * @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')]]); }
/** * Set a new value * @return string */ public function setCurrentChannel($newChannel) { $cleanValue = preg_replace('/[^A-Za-z0-9]/', '', $newChannel); \OCP\Util::setChannel($cleanValue); return $cleanValue; }