/** * Get note for video url * * @return \Magento\Framework\Phrase */ protected function getNoteVideoUrl() { $result = __('YouTube and Vimeo supported.'); if ($this->mediaHelper->getYouTubeApiKey() === null) { $result = __('Vimeo supported.<br />' . 'To add YouTube video, please <a href="%1">enter YouTube API Key</a> first.', $this->getConfigApiKeyUrl()); } return $result; }
/** * Get widget options * * @return string */ public function getWidgetOptions() { return $this->jsonEncoder->encode(['saveVideoUrl' => $this->getUrl('catalog/product_gallery/upload'), 'saveRemoteVideoUrl' => $this->getUrl('product_video/product_gallery/retrieveImage'), 'htmlId' => $this->getHtmlId(), 'youTubeApiKey' => $this->mediaHelper->getYouTubeApiKey()]); }
/** * Test for method getYouTubeApiKey */ public function testGetYouTubeApiKey() { $return = 'some_value'; $this->scopeConfigMock->expects($this->once())->method('getValue')->with(Media::XML_PATH_YOUTUBE_API_KEY)->will($this->returnValue($return)); $this->assertEquals($return, $this->helper->getYouTubeApiKey()); }